|
12 éve | |
---|---|---|
.. | ||
encodings | 12 éve | |
generation | 12 éve | |
test | 12 éve | |
.npmignore | 12 éve | |
.travis.yml | 12 éve | |
LICENSE | 12 éve | |
README.md | 12 éve | |
index.js | 12 éve | |
package.json | 12 éve |
var iconv = require('iconv-lite');
// Convert from an encoded buffer to string.
str = iconv.decode(buf, 'win1251');
// Convert from string to an encoded buffer.
buf = iconv.encode("Sample input string", 'win1251');
Others are easy to add, see the source. Please, participate. Most encodings are generated from node-iconv. Thank you Ben Noordhuis and iconv authors!
Not supported yet: Big5, EUC family, Shift_JIS.
Comparison with node-iconv module (1000x256kb, on Ubuntu 12.04, Core i5/2.5 GHz, Node v0.8.7). Note: your results may vary, so please always check on your hardware.
operation [email protected] [email protected]
----------------------------------------------------------
encode('win1251') ~115 Mb/s ~230 Mb/s
decode('win1251') ~95 Mb/s ~130 Mb/s
Untranslatable characters are set to � or ?. No transliteration is currently supported, pull requests are welcome.
npm install --dev iconv-lite
vows
# To view performance:
node test/performance.js