|
6 | 6 | * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison).
|
7 | 7 | * Intuitive encode/decode API
|
8 | 8 | * Streaming support for Node v0.10+
|
9 |
| - * [Deprecated] Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings. |
10 | 9 | * In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included).
|
11 | 10 | * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included.
|
12 | 11 | * React Native is supported (need to explicitly `npm install` two more modules: `buffer` and `stream`).
|
@@ -61,40 +60,6 @@ http.createServer(function(req, res) {
|
61 | 60 | });
|
62 | 61 | ```
|
63 | 62 |
|
64 |
| -### [Deprecated] Extend Node.js own encodings |
65 |
| -> NOTE: This doesn't work on latest Node versions. See [details](https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility). |
66 |
| -
|
67 |
| -```javascript |
68 |
| -// After this call all Node basic primitives will understand iconv-lite encodings. |
69 |
| -iconv.extendNodeEncodings(); |
70 |
| - |
71 |
| -// Examples: |
72 |
| -buf = new Buffer(str, 'win1251'); |
73 |
| -buf.write(str, 'gbk'); |
74 |
| -str = buf.toString('latin1'); |
75 |
| -assert(Buffer.isEncoding('iso-8859-15')); |
76 |
| -Buffer.byteLength(str, 'us-ascii'); |
77 |
| - |
78 |
| -http.createServer(function(req, res) { |
79 |
| - req.setEncoding('big5'); |
80 |
| - req.collect(function(err, body) { |
81 |
| - console.log(body); |
82 |
| - }); |
83 |
| -}); |
84 |
| - |
85 |
| -fs.createReadStream("file.txt", "shift_jis"); |
86 |
| - |
87 |
| -// External modules are also supported (if they use Node primitives, which they probably do). |
88 |
| -request = require('request'); |
89 |
| -request({ |
90 |
| - url: "http://github.com/", |
91 |
| - encoding: "cp932" |
92 |
| -}); |
93 |
| - |
94 |
| -// To remove extensions |
95 |
| -iconv.undoExtendNodeEncodings(); |
96 |
| -``` |
97 |
| - |
98 | 63 | ## Supported encodings
|
99 | 64 |
|
100 | 65 | * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex.
|
|
0 commit comments