restore npm dependency on iconv-lite

fork
mscdex 11 years ago
parent 41554f5188
commit 7dd577a133

@ -1,3 +0,0 @@
node_modules
*~
*sublime-*

@ -1,5 +0,0 @@
language: node_js
node_js:
- 0.4
- 0.6
- 0.8

@ -1,21 +0,0 @@
Copyright (c) 2011 Alexander Shtuchkin
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@ -1,68 +0,0 @@
iconv-lite - pure javascript character encoding conversion
======================================================================
[![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite)
## Features
* Pure javascript. Doesn't need native code compilation.
* Easy API.
* Works on Windows and in sandboxed environments like [Cloud9](http://c9.io).
* Encoding is much faster than node-iconv (see below for performance comparison).
## Usage
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');
## Supported encodings
* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'
* All widespread single byte encodings: Windows 125x family, ISO-8859 family,
IBM/DOS codepages, Macintosh family, KOI8 family.
Aliases like 'latin1', 'us-ascii' also supported.
* Multibyte encodings: 'gbk', 'gb2313', 'Big5', 'cp950'.
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: EUC family, Shift_JIS.
## Encoding/decoding speed
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 iconv@1.2.4 iconv-lite@0.2.4
----------------------------------------------------------
encode('win1251') ~115 Mb/s ~230 Mb/s
decode('win1251') ~95 Mb/s ~130 Mb/s
## Notes
When decoding, a 'binary'-encoded string can be used as a source buffer.
Untranslatable characters are set to <20> or ?. No transliteration is currently supported, pull requests are welcome.
## Testing
git clone git@github.com:ashtuchkin/iconv-lite.git
cd iconv-lite
npm install
npm test
# To view performance:
node test/performance.js
## TODO
* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')).
* Add more encodings.
* Add transliteration (best fit char).
* Add tests and correct support of variable-byte encodings (currently work is delegated to node).

@ -1,9 +0,0 @@
var big5Table = require('./table/big5.js');
module.exports = {
'windows950': 'big5',
'cp950': 'big5',
'big5': {
type: 'table',
table: big5Table
}
}

@ -1,9 +0,0 @@
var gbkTable = require('./table/gbk.js');
module.exports = {
'windows936': 'gbk',
'gb2312': 'gbk',
'gbk': {
type: 'table',
table: gbkTable
}
}

@ -1,340 +0,0 @@
module.exports = {
"437": "cp437",
"737": "cp737",
"775": "cp775",
"850": "cp850",
"852": "cp852",
"855": "cp855",
"857": "cp857",
"858": "cp858",
"860": "cp860",
"861": "cp861",
"862": "cp862",
"863": "cp863",
"864": "cp864",
"865": "cp865",
"866": "cp866",
"869": "cp869",
"874": "iso885911",
"1250": "windows1250",
"1251": "windows1251",
"1252": "windows1252",
"1253": "windows1253",
"1254": "windows1254",
"1255": "windows1255",
"1256": "windows1256",
"1257": "windows1257",
"1258": "windows1258",
"10000": "macroman",
"10006": "macgreek",
"10007": "maccyrillic",
"10029": "maccenteuro",
"10079": "maciceland",
"10081": "macturkish",
"20866": "koi8r",
"21866": "koi8u",
"28591": "iso88591",
"28592": "iso88592",
"28593": "iso88593",
"28594": "iso88594",
"28595": "iso88595",
"28596": "iso88596",
"28597": "iso88597",
"28598": "iso88598",
"28599": "iso88599",
"28600": "iso885910",
"28601": "iso885911",
"28603": "iso885913",
"28604": "iso885914",
"28605": "iso885915",
"28606": "iso885916",
"ascii8bit": "ascii",
"usascii": "ascii",
"latin1": "iso88591",
"latin2": "iso88592",
"latin3": "iso88593",
"latin4": "iso88594",
"latin6": "iso885910",
"latin7": "iso885913",
"latin8": "iso885914",
"latin9": "iso885915",
"latin10": "iso885916",
"cp819": "iso88951",
"arabic": "iso88596",
"arabic8": "iso88596",
"greek": "iso88597",
"greek8": "iso88597",
"hebrew": "iso88598",
"hebrew8": "iso88598",
"turkish": "iso88599",
"turkish8": "iso88599",
"thai": "iso885911",
"thai8": "iso885911",
"tis620": "iso885911",
"windows874": "iso885911",
"win874": "iso885911",
"cp874": "iso885911",
"celtic": "iso885914",
"celtic8": "iso885914",
"cp20866": "koi8r",
"ibm878": "koi8r",
"cp21866": "koi8u",
"ibm1168": "koi8u",
"windows1250": {
"type": "singlebyte",
"chars": "€<><EFBFBD>„…†‡<E280A0>‰ŠŚŤŽŹ<C5BD>“”•<E28093>™šśťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
},
"win1250": "windows1250",
"cp1250": "windows1250",
"windows1251": {
"type": "singlebyte",
"chars": "ЂЃѓ„…†‡€‰ЉЊЌЋЏђ“”•<E28093>™љњќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
},
"win1251": "windows1251",
"cp1251": "windows1251",
"windows1252": {
"type": "singlebyte",
"chars": "€<>ƒ„…†‡ˆ‰ŠŒ<E280B9>Ž<EFBFBD><C5BD>“”•˜™šœ<E280BA>žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
},
"win1252": "windows1252",
"cp1252": "windows1252",
"windows1253": {
"type": "singlebyte",
"chars": "€<>ƒ„…†‡<E280A0><EFBFBD><EFBFBD><E280B9><EFBFBD><EFBFBD><EFBFBD>“”•<E28093><EFBFBD><EFBFBD><E280BA><EFBFBD><EFBFBD> ΅Ά£¤¥¦§¨©<C2A8>«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ<CEA0>ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ<CF8D>"
},
"win1253": "windows1253",
"cp1253": "windows1253",
"windows1254": {
"type": "singlebyte",
"chars": "€<>ƒ„…†‡ˆ‰ŠŒ<E280B9><C592><EFBFBD><EFBFBD>“”•˜™šœ<E280BA><C593>Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
},
"win1254": "windows1254",
"cp1254": "windows1254",
"windows1255": {
"type": "singlebyte",
"chars": "€<>ƒ„…†‡ˆ<CB86><EFBFBD><E280B9><EFBFBD><EFBFBD><EFBFBD>“”•˜<CB9C><EFBFBD><E280BA><EFBFBD><EFBFBD> ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ<D6B8>ֻּֽ־ֿ׀ׁׂ׃װױײ׳״<D7B3><D7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>אבגדהוזחטיךכלםמןנסעףפץצקרשת<D7A9><D7AA><E2808E>"
},
"win1255": "windows1255",
"cp1255": "windows1255",
"windows1256": {
"type": "singlebyte",
"chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"
},
"win1256": "windows1256",
"cp1256": "windows1256",
"windows1257": {
"type": "singlebyte",
"chars": "€<><EFBFBD>„…†‡<E280A0><EFBFBD><EFBFBD>¨ˇ¸<CB87>“”•<E28093><EFBFBD><EFBFBD>¯˛<C2AF> <EFBFBD>¢£¤<C2A3>¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"
},
"win1257": "windows1257",
"cp1257": "windows1257",
"windows1258": {
"type": "singlebyte",
"chars": "€<>ƒ„…†‡ˆ<CB86>Œ<E280B9><C592><EFBFBD><EFBFBD>“”•˜<CB9C>œ<E280BA><C593>Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
},
"win1258": "windows1258",
"cp1258": "windows1258",
"iso88591": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
},
"cp28591": "iso88591",
"iso88592": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
},
"cp28592": "iso88592",
"iso88593": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤<C2A3>Ĥ§¨İŞĞĴ­<C4B4>Ż°ħ²³´µĥ·¸ışğĵ½<C4B5>żÀÁÂ<C381>ÄĊĈÇÈÉÊËÌÍÎÏ<C38E>ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ<C3A1>äċĉçèéêëìíîï<C3AE>ñòóôġö÷ĝùúûüŭŝ˙"
},
"cp28593": "iso88593",
"iso88594": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"
},
"cp28594": "iso88594",
"iso88595": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"
},
"cp28595": "iso88595",
"iso88596": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ <C29F><C2A0><EFBFBD>¤<EFBFBD><C2A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>،­<D88C><C2AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>؛<EFBFBD><D89B><EFBFBD>؟<EFBFBD>ءآأؤإئابةتثجحخدذرزسشصضطظعغ<D8B9><D8BA><EFBFBD><EFBFBD><EFBFBD>ـفقكلمنهوىيًٌٍَُِّْ<D991><D992><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
},
"cp28596": "iso88596",
"iso88597": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ £€₯¦§¨©ͺ«¬­<C2AC>―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ<CEA0>ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ<CF8D>"
},
"cp28597": "iso88597",
"iso88598": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ <C29F>¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾<C2BD><C2BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‗אבגדהוזחטיךכלםמןנסעףפץצקרשת<D7A9><D7AA><E2808E>"
},
"cp28598": "iso88598",
"iso88599": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
},
"cp28599": "iso88599",
"iso885910": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"
},
"cp28600": "iso885910",
"iso885911": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู<E0B8B9><E0B8BA><EFBFBD><EFBFBD>฿เแโใไๅๆ็่้๊๋์ํ๎๏๑๒๓๔๕๖๗๘๙๚๛<E0B99A><E0B99B><EFBFBD><EFBFBD>"
},
"cp28601": "iso885911",
"iso885913": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"
},
"cp28603": "iso885913",
"iso885914": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"
},
"cp28604": "iso885914",
"iso885915": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
},
"cp28605": "iso885915",
"iso885916": {
"type": "singlebyte",
"chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"
},
"cp28606": "iso885916",
"cp437": {
"type": "singlebyte",
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm437": "cp437",
"cp737": {
"type": "singlebyte",
"chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "
},
"ibm737": "cp737",
"cp775": {
"type": "singlebyte",
"chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "
},
"ibm775": "cp775",
"cp850": {
"type": "singlebyte",
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
},
"ibm850": "cp850",
"cp852": {
"type": "singlebyte",
"chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "
},
"ibm852": "cp852",
"cp855": {
"type": "singlebyte",
"chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "
},
"ibm855": "cp855",
"cp857": {
"type": "singlebyte",
"chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ<C38B>ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ<C395>×ÚÛÙìÿ¯´­±<C2AD>¾¶§÷¸°¨·¹³²■ "
},
"ibm857": "cp857",
"cp858": {
"type": "singlebyte",
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
},
"ibm858": "cp858",
"cp860": {
"type": "singlebyte",
"chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm860": "cp860",
"cp861": {
"type": "singlebyte",
"chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm861": "cp861",
"cp862": {
"type": "singlebyte",
"chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm862": "cp862",
"cp863": {
"type": "singlebyte",
"chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm863": "cp863",
"cp864": {
"type": "singlebyte",
"chars": "°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ<EFBBB7><EFBBB8>ﻻﻼ<EFBBBB> ­ﺂ£¤ﺄ<C2A4><EFBA84>ﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻰﻲﻐﻕﻵﻶﻝﻙﻱ■<EFBBB1>"
},
"ibm864": "cp864",
"cp865": {
"type": "singlebyte",
"chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
},
"ibm865": "cp865",
"cp866": {
"type": "singlebyte",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "
},
"ibm866": "cp866",
"cp869": {
"type": "singlebyte",
"chars": "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ά<EFBFBD>·¬¦Έ―ΉΊΪΌ<CEAA><CE8C>ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "
},
"ibm869": "cp869",
"maccenteuro": {
"type": "singlebyte",
"chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"
},
"maccroatian": {
"type": "singlebyte",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”÷◊<C3B7>©¤Æ»·„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
},
"maccyrillic": {
"type": "singlebyte",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
},
"macgreek": {
"type": "singlebyte",
"chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡΤ«»… ΥΧΆΈœ―“”÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ<CE90>"
},
"maciceland": {
"type": "singlebyte",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸ¤ÐðÞþý·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
},
"macroman": {
"type": "singlebyte",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸ¤fifl‡·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
},
"macromania": {
"type": "singlebyte",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸ¤Ţţ‡·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
},
"macthai": {
"type": "singlebyte",
"chars": "«»…“”<E2809D>•<E28098> กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู—฿เแโใไๅๆ็่้๊๋์ํ™๏๑๒๓๔๕๖๗๘๙®©<C2AE><C2A9><EFBFBD><EFBFBD>"
},
"macturkish": {
"type": "singlebyte",
"chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ—“”÷◊ÿŸĞğİıŞş‡·„‰ÂÊÁËÈÍÎÏÌÓÔ<C393>ÒÚÛÙ<C39B>ˆ˜¯˘˙˚¸˝˛ˇ"
},
"macukraine": {
"type": "singlebyte",
"chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
},
"koi8r": {
"type": "singlebyte",
"chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
},
"koi8u": {
"type": "singlebyte",
"chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
}
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,25 +0,0 @@
var http = require('http');
var fs = require('fs');
// BIG5
var cp950_b2u = {host:'moztw.org',path:'/docs/big5/table/cp950-b2u.txt'},
cp950_u2b = {host:'moztw.org',path:'/docs/big5/table/cp950-u2b.txt'},
cp950_moz18_b2u = {host:'moztw.org',path:'/docs/big5/table/moz18-b2u.txt'};
http.get(cp950_moz18_b2u, function(res) {
var data = '';
res.on('data', function(chunk) {
data += chunk;
});
res.on('end', function() {
var table = {};
data = data.split('\n').slice(1);
data.forEach(function(line, idx) {
var pair = line.split(' ');
var key = parseInt(pair[0]);
var val = parseInt(pair[1]);
table[key] = val;
});
fs.createWriteSync('encodings/table/big5.js',
'module.exports = ' + JSON.stringify(table) + ';');
});
});

@ -1,142 +0,0 @@
var fs = require("fs");
var Iconv = require("iconv").Iconv;
var encodingFamilies = [
{
// Windows code pages
encodings: [1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258],
convert: function(cp) {
return {
name: "windows-"+cp,
aliases: ["win"+cp, "cp"+cp, ""+cp],
}
}
},
{
// ISO-8859 code pages
encodings: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16],
convert: function(i) {
return {
name: "iso-8859-"+i,
aliases: ["cp"+(28590+i), (28590+i)],
}
}
},
{
// IBM/DOS code pages
encodings: [437, 737, 775, 850, 852, 855, 857, 858, 860, 861, 862, 863, 864, 865, 866, 869],
convert: function(cp) {
return {
name: "CP"+cp,
aliases: ["ibm"+cp, ""+cp],
}
}
},
{
// Macintosh code pages
encodings: ["macCroatian", "macCyrillic", "macGreek",
"macIceland", "macRoman", "macRomania",
"macThai", "macTurkish", "macUkraine"],
},
{
// KOI8 code pages
encodings: ["KOI8-R", "KOI8-U"],
},
];
var encodings = {
// Aliases.
"ascii8bit": "ascii",
"usascii": "ascii",
"latin1": "iso88591",
"latin2": "iso88592",
"latin3": "iso88593",
"latin4": "iso88594",
"latin6": "iso885910",
"latin7": "iso885913",
"latin8": "iso885914",
"latin9": "iso885915",
"latin10": "iso885916",
"cp819": "iso88951",
"arabic": "iso88596",
"arabic8": "iso88596",
"greek" : "iso88597",
"greek8" : "iso88597",
"hebrew": "iso88598",
"hebrew8": "iso88598",
"turkish": "iso88599",
"turkish8": "iso88599",
"thai": "iso885911",
"thai8": "iso885911",
"tis620": "iso885911",
"windows874": "iso885911",
"win874": "iso885911",
"cp874": "iso885911",
"874": "iso885911",
"celtic": "iso885914",
"celtic8": "iso885914",
"cp20866": "koi8r",
"20866": "koi8r",
"ibm878": "koi8r",
"cp21866": "koi8u",
"21866": "koi8u",
"ibm1168": "koi8u",
};
// Add all encodings from encodingFamilies.
encodingFamilies.forEach(function(family){
family.encodings.forEach(function(encoding){
if (family.convert)
encoding = family.convert(encoding);
var encodingIconvName = encoding.name ? encoding.name : encoding;
var encodingName = encodingIconvName.replace(/[-_]/g, "").toLowerCase();
encodings[encodingName] = {
type: "singlebyte",
chars: generateCharsString(encodingIconvName)
};
if (encoding.aliases)
encoding.aliases.forEach(function(alias){
encodings[alias] = encodingName;
});
});
});
// Write encodings.
fs.writeFileSync("encodings/singlebyte.js",
"module.exports = " + JSON.stringify(encodings, undefined, " ") + ";");
function generateCharsString(encoding) {
console.log("Generate encoding for " + encoding);
var iconvToUtf8 = new Iconv(encoding, "UTF-8");
var chars = "";
for (var b = 0x80; b < 0x100; b++) {
try {
var convertedChar = iconvToUtf8.convert(new Buffer([b])).toString();
if (convertedChar.length != 1)
throw new Error("Single-byte encoding error: Must return single char.");
} catch (exception) {
if (exception.code === "EILSEQ") {
convertedChar = "\ufffd";
} else {
throw exception;
}
}
chars += convertedChar;
}
return chars;
}

@ -1,231 +0,0 @@
var RE_SPACEDASH = /[- ]/g;
// Module exports
var iconv = module.exports = {
toEncoding: function(str, encoding) {
return iconv.getCodec(encoding).toEncoding(str);
},
fromEncoding: function(buf, encoding) {
return iconv.getCodec(encoding).fromEncoding(buf);
},
encodingExists: function(enc) {
loadEncodings();
enc = enc.replace(RE_SPACEDASH, "").toLowerCase();
return (iconv.encodings[enc] !== undefined);
},
defaultCharUnicode: '<27>',
defaultCharSingleByte: '?',
encodingsLoaded: false,
// Get correct codec for given encoding.
getCodec: function(encoding) {
loadEncodings();
var enc = encoding || "utf8";
var codecOptions = undefined;
while (1) {
if (getType(enc) === "String")
enc = enc.replace(RE_SPACEDASH, "").toLowerCase();
var codec = iconv.encodings[enc];
var type = getType(codec);
if (type === "String") {
// Link to other encoding.
codecOptions = {originalEncoding: enc};
enc = codec;
}
else if (type === "Object" && codec.type != undefined) {
// Options for other encoding.
codecOptions = codec;
enc = codec.type;
}
else if (type === "Function")
// Codec itself.
return codec(codecOptions);
else
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
}
},
// Define basic encodings
encodings: {
internal: function(options) {
return {
toEncoding: toInternalEncoding,
fromEncoding: fromInternalEncoding,
options: options
};
},
utf8: "internal",
ucs2: "internal",
binary: "internal",
ascii: "internal",
base64: "internal",
// Codepage single-byte encodings.
singlebyte: function(options) {
// Prepare chars if needed
if (!options.charsBuf) {
if (!options.chars || (options.chars.length !== 128 && options.chars.length !== 256))
throw new Error("Encoding '"+options.type+"' has incorrect 'chars' (must be of len 128 or 256)");
if (options.chars.length === 128)
options.chars = asciiString + options.chars;
options.charsBuf = new Buffer(options.chars, 'ucs2');
}
if (!options.revCharsBuf) {
options.revCharsBuf = new Buffer(65536);
var defChar = iconv.defaultCharSingleByte.charCodeAt(0);
for (var i = 0; i < options.revCharsBuf.length; i++)
options.revCharsBuf[i] = defChar;
for (var i = 0; i < options.chars.length; i++)
options.revCharsBuf[options.chars.charCodeAt(i)] = i;
}
return {
toEncoding: toSingleByteEncoding,
fromEncoding: fromSingleByteEncoding,
options: options,
};
},
// Codepage double-byte encodings.
table: function(options) {
if (!options.table) {
throw new Error("Encoding '" + options.type + "' has incorect 'table' option");
}
if (!options.revCharsTable) {
var revCharsTable = options.revCharsTable = {};
for (var i = 0; i <= 0xFFFF; i++) {
revCharsTable[i] = 0;
}
var table = options.table;
for (var key in table) {
revCharsTable[table[key]] = +key;
}
}
return {
toEncoding: toTableEncoding,
fromEncoding: fromTableEncoding,
options: options,
};
}
}
};
function toInternalEncoding(str) {
return new Buffer(ensureString(str), this.options.originalEncoding);
}
function fromInternalEncoding(buf) {
return ensureBuffer(buf).toString(this.options.originalEncoding);
}
function toTableEncoding(str) {
str = ensureString(str);
var strLen = str.length;
var revCharsTable = this.options.revCharsTable;
var newBuf = new Buffer(strLen*2), gbkcode, unicode,
defaultChar = revCharsTable[iconv.defaultCharUnicode.charCodeAt(0)];
for (var i = 0, j = 0; i < strLen; i++) {
unicode = str.charCodeAt(i);
if (unicode >> 7) {
gbkcode = revCharsTable[unicode] || defaultChar;
newBuf[j++] = gbkcode >> 8; //high byte;
newBuf[j++] = gbkcode & 0xFF; //low byte
} else {//ascii
newBuf[j++] = unicode;
}
}
return newBuf.slice(0, j);
}
function fromTableEncoding(buf) {
buf = ensureBuffer(buf);
var bufLen = buf.length;
var table = this.options.table;
var newBuf = new Buffer(bufLen*2), unicode, gbkcode,
defaultChar = iconv.defaultCharUnicode.charCodeAt(0);
for (var i = 0, j = 0; i < bufLen; i++, j+=2) {
gbkcode = buf[i];
if (gbkcode & 0x80) {
gbkcode = (gbkcode << 8) + buf[++i];
unicode = table[gbkcode] || defaultChar;
} else {
unicode = gbkcode;
}
newBuf[j] = unicode & 0xFF; //low byte
newBuf[j+1] = unicode >> 8; //high byte
}
return newBuf.slice(0, j).toString('ucs2');
}
function toSingleByteEncoding(str) {
str = ensureString(str);
var buf = new Buffer(str.length);
var revCharsBuf = this.options.revCharsBuf;
for (var i = 0; i < str.length; i++)
buf[i] = revCharsBuf[str.charCodeAt(i)];
return buf;
}
function fromSingleByteEncoding(buf) {
buf = ensureBuffer(buf);
// Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
var charsBuf = this.options.charsBuf;
var newBuf = new Buffer(buf.length*2);
var idx1 = 0, idx2 = 0;
for (var i = 0, _len = buf.length; i < _len; i++) {
idx1 = buf[i]*2; idx2 = i*2;
newBuf[idx2] = charsBuf[idx1];
newBuf[idx2+1] = charsBuf[idx1+1];
}
return newBuf.toString('ucs2');
}
// Add aliases to convert functions
iconv.encode = iconv.toEncoding;
iconv.decode = iconv.fromEncoding;
// Load other encodings manually from files in /encodings dir.
function loadEncodings() {
if (!iconv.encodingsLoaded) {
[ require('./encodings/singlebyte'),
require('./encodings/gbk'),
require('./encodings/big5')
].forEach(function(encodings) {
for (var key in encodings)
iconv.encodings[key] = encodings[key]
});
iconv.encodingsLoaded = true;
}
}
// Utilities
var asciiString = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f';
var ensureBuffer = function(buf) {
buf = buf || new Buffer(0);
return (buf instanceof Buffer) ? buf : new Buffer(""+buf, "binary");
}
var ensureString = function(str) {
str = str || "";
return (str instanceof Buffer) ? str.toString('utf8') : (""+str);
}
var getType = function(obj) {
return Object.prototype.toString.call(obj).slice(8, -1);
}

@ -1,222 +0,0 @@
// Module exports
var iconv = module.exports = {
toEncoding: function(str, encoding) {
return iconv.getCodec(encoding).toEncoding(str);
},
fromEncoding: function(buf, encoding) {
return iconv.getCodec(encoding).fromEncoding(buf);
},
defaultCharUnicode: '<27>',
defaultCharSingleByte: '?',
encodingsLoaded: false,
// Get correct codec for given encoding.
getCodec: function(encoding) {
if (!iconv.encodingsLoaded) {
applyEncodings(require('./encodings/singlebyte'));
applyEncodings(require('./encodings/gbk'));
applyEncodings(require('./encodings/big5'));
iconv.encodingsLoaded = true;
}
var enc = encoding || "utf8";
var codecOptions = undefined;
while (1) {
if (getType(enc) === "String")
enc = enc.replace(/[- ]/g, "").toLowerCase();
var codec = iconv.encodings[enc];
var type = getType(codec);
if (type === "String") {
// Link to other encoding.
codecOptions = {originalEncoding: enc};
enc = codec;
}
else if (type === "Object" && codec.type != undefined) {
// Options for other encoding.
codecOptions = codec;
enc = codec.type;
}
else if (type === "Function")
// Codec itself.
return codec(codecOptions);
else
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
}
},
// Define basic encodings
encodings: {
internal: function(options) {
return {
toEncoding: toInternalEncoding,
fromEncoding: fromInternalEncoding,
options: options
};
},
utf8: "internal",
ucs2: "internal",
binary: "internal",
ascii: "internal",
base64: "internal",
// Codepage single-byte encodings.
singlebyte: function(options) {
// Prepare chars if needed
if (!options.charsBuf) {
if (!options.chars || (options.chars.length !== 128 && options.chars.length !== 256))
throw new Error("Encoding '"+options.type+"' has incorrect 'chars' (must be of len 128 or 256)");
if (options.chars.length === 128)
options.chars = asciiString + options.chars;
options.charsBuf = new Buffer(options.chars, 'ucs2');
}
if (!options.revCharsBuf) {
options.revCharsBuf = new Buffer(65536);
var defChar = iconv.defaultCharSingleByte.charCodeAt(0);
for (var i = 0; i < options.revCharsBuf.length; i++)
options.revCharsBuf[i] = defChar;
for (var i = 0; i < options.chars.length; i++)
options.revCharsBuf[options.chars.charCodeAt(i)] = i;
}
return {
toEncoding: toSingleByteEncoding,
fromEncoding: fromSingleByteEncoding,
options: options,
};
},
// Codepage double-byte encodings.
table: function(options) {
if (!options.table) {
throw new Error("Encoding '" + options.type + "' has incorect 'table' option");
}
if (!options.revCharsTable) {
var revCharsTable = options.revCharsTable = {};
for (var i = 0; i <= 0xFFFF; i++) {
revCharsTable[i] = 0;
}
var table = options.table;
for (var key in table) {
revCharsTable[table[key]] = +key;
}
}
return {
toEncoding: toTableEncoding,
fromEncoding: fromTableEncoding,
options: options,
};
}
}
};
function toInternalEncoding(str) {
return new Buffer(ensureString(str), this.options.originalEncoding);
}
function fromInternalEncoding(buf) {
return ensureBuffer(buf).toString(this.options.originalEncoding);
}
function toTableEncoding(str) {
str = ensureString(str);
var strLen = str.length;
var revCharsTable = this.options.revCharsTable;
var newBuf = new Buffer(strLen*2), gbkcode, unicode,
defaultChar = revCharsTable[iconv.defaultCharUnicode.charCodeAt(0)];
for (var i = 0, j = 0; i < strLen; i++) {
unicode = str.charCodeAt(i);
if (unicode >> 7) {
gbkcode = revCharsTable[unicode] || defaultChar;
newBuf[j++] = gbkcode >> 8; //high byte;
newBuf[j++] = gbkcode & 0xFF; //low byte
} else {//ascii
newBuf[j++] = unicode;
}
}
return newBuf.slice(0, j);
}
function fromTableEncoding(buf) {
buf = ensureBuffer(buf);
var bufLen = buf.length;
var table = this.options.table;
var newBuf = new Buffer(bufLen*2), unicode, gbkcode,
defaultChar = iconv.defaultCharUnicode.charCodeAt(0);
for (var i = 0, j = 0; i < bufLen; i++, j+=2) {
gbkcode = buf[i];
if (gbkcode & 0x80) {
gbkcode = (gbkcode << 8) + buf[++i];
unicode = table[gbkcode] || defaultChar;
} else {
unicode = gbkcode;
}
newBuf[j] = unicode & 0xFF; //low byte
newBuf[j+1] = unicode >> 8; //high byte
}
return newBuf.slice(0, j).toString('ucs2');
}
function toSingleByteEncoding(str) {
str = ensureString(str);
var buf = new Buffer(str.length);
var revCharsBuf = this.options.revCharsBuf;
for (var i = 0; i < str.length; i++)
buf[i] = revCharsBuf[str.charCodeAt(i)];
return buf;
}
function fromSingleByteEncoding(buf) {
buf = ensureBuffer(buf);
// Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
var charsBuf = this.options.charsBuf;
var newBuf = new Buffer(buf.length*2);
var idx1 = 0, idx2 = 0;
for (var i = 0, _len = buf.length; i < _len; i++) {
idx1 = buf[i]*2; idx2 = i*2;
newBuf[idx2] = charsBuf[idx1];
newBuf[idx2+1] = charsBuf[idx1+1];
}
return newBuf.toString('ucs2');
}
// Add aliases to convert functions
iconv.encode = iconv.toEncoding;
iconv.decode = iconv.fromEncoding;
// Load other encodings manually from files in /encodings dir.
function applyEncodings(encodings) {
for (var key in encodings)
iconv.encodings[key] = encodings[key]
}
// Utilities
var asciiString = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f';
var ensureBuffer = function(buf) {
buf = buf || new Buffer(0);
return (buf instanceof Buffer) ? buf : new Buffer(""+buf, "binary");
}
var ensureString = function(str) {
str = str || "";
return (str instanceof Buffer) ? str.toString('utf8') : (""+str);
}
var getType = function(obj) {
return Object.prototype.toString.call(obj).slice(8, -1);
}

@ -1,80 +0,0 @@
{
"name": "iconv-lite",
"description": "Convert character encodings in pure javascript.",
"version": "0.2.10",
"license": "MIT",
"keywords": [
"iconv",
"convert",
"charset"
],
"author": {
"name": "Alexander Shtuchkin",
"email": "ashtuchkin@gmail.com"
},
"contributors": [
{
"name": "Jinwu Zhan",
"url": "https://github.com/jenkinv"
},
{
"name": "Adamansky Anton",
"url": "https://github.com/adamansky"
},
{
"name": "George Stagas",
"url": "https://github.com/stagas"
},
{
"name": "Mike D Pilsbury",
"url": "https://github.com/pekim"
},
{
"name": "Niggler",
"url": "https://github.com/Niggler"
},
{
"name": "wychi",
"url": "https://github.com/wychi"
},
{
"name": "David Kuo",
"url": "https://github.com/david50407"
},
{
"name": "ChangZhuo Chen",
"url": "https://github.com/czchen"
},
{
"name": "Lee Treveil",
"url": "https://github.com/leetreveil"
}
],
"main": "index.js",
"homepage": "https://github.com/ashtuchkin/iconv-lite",
"repository": {
"type": "git",
"url": "git://github.com/ashtuchkin/iconv-lite.git"
},
"engines": {
"node": ">=0.4.0"
},
"scripts": {
"test": "vows --spec"
},
"devDependencies": {
"vows": "",
"iconv": ">=1.1"
},
"readme": "iconv-lite - pure javascript character encoding conversion\n======================================================================\n\n[![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite)\n\n## Features\n\n* Pure javascript. Doesn't need native code compilation.\n* Easy API.\n* Works on Windows and in sandboxed environments like [Cloud9](http://c9.io).\n* Encoding is much faster than node-iconv (see below for performance comparison).\n\n## Usage\n\n var iconv = require('iconv-lite');\n \n // Convert from an encoded buffer to string.\n str = iconv.decode(buf, 'win1251');\n \n // Convert from string to an encoded buffer.\n buf = iconv.encode(\"Sample input string\", 'win1251');\n\n## Supported encodings\n\n* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'\n* All widespread single byte encodings: Windows 125x family, ISO-8859 family, \n IBM/DOS codepages, Macintosh family, KOI8 family. \n Aliases like 'latin1', 'us-ascii' also supported.\n* Multibyte encodings: 'gbk', 'gb2313', 'Big5', 'cp950'.\n\nOthers are easy to add, see the source. Please, participate.\nMost encodings are generated from node-iconv. Thank you Ben Noordhuis and iconv authors!\n\nNot supported yet: EUC family, Shift_JIS.\n\n\n## Encoding/decoding speed\n\nComparison with node-iconv module (1000x256kb, on Ubuntu 12.04, Core i5/2.5 GHz, Node v0.8.7). \nNote: your results may vary, so please always check on your hardware.\n\n operation iconv@1.2.4 iconv-lite@0.2.4 \n ----------------------------------------------------------\n encode('win1251') ~115 Mb/s ~230 Mb/s\n decode('win1251') ~95 Mb/s ~130 Mb/s\n\n\n## Notes\n\nWhen decoding, a 'binary'-encoded string can be used as a source buffer. \nUntranslatable characters are set to <20> or ?. No transliteration is currently supported, pull requests are welcome.\n\n## Testing\n\n git clone git@github.com:ashtuchkin/iconv-lite.git\n cd iconv-lite\n npm install\n npm test\n \n # To view performance:\n node test/performance.js\n\n## TODO\n\n* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')).\n* Add more encodings.\n* Add transliteration (best fit char).\n* Add tests and correct support of variable-byte encodings (currently work is delegated to node).\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/ashtuchkin/iconv-lite/issues"
},
"_id": "iconv-lite@0.2.10",
"dist": {
"shasum": "5a6567bcdacf070cad3e0bd29b9a855ad030af49"
},
"_from": "iconv-lite@0.2.10",
"_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.10.tgz"
}

@ -1,36 +0,0 @@
var vows = require('vows'),
fs = require('fs'),
assert = require('assert'),
iconv = require(__dirname + '/../');
var testString = "中文abc", //unicode contains Big5-code and ascii
testStringBig5Buffer = new Buffer([0xa4,0xa4,0xa4,0xe5,0x61,0x62,0x63]),
testString2 = '測試',
testStringBig5Buffer2 = new Buffer([0xb4, 0xfa, 0xb8, 0xd5]);
vows.describe("Big5 tests").addBatch({
"Big5 correctly encoded/decoded": function() {
assert.strictEqual(iconv.toEncoding(testString, "big5").toString('binary'), testStringBig5Buffer.toString('binary'));
assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer, "big5"), testString);
assert.strictEqual(iconv.toEncoding(testString2, 'big5').toString('binary'), testStringBig5Buffer2.toString('binary'));
assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer2, 'big5'), testString2);
},
"cp950 correctly encoded/decoded": function() {
assert.strictEqual(iconv.toEncoding(testString, "cp950").toString('binary'), testStringBig5Buffer.toString('binary'));
assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer, "cp950"), testString);
},
"Big5 file read decoded,compare with iconv result": function() {
var contentBuffer = fs.readFileSync(__dirname+"/big5File.txt");
var str = iconv.fromEncoding(contentBuffer, "big5");
var iconvc = new (require('iconv').Iconv)('big5','utf8');
assert.strictEqual(iconvc.convert(contentBuffer).toString(), str);
},
"Big5 correctly decodes and encodes characters · and ×": function() {
// https://github.com/ashtuchkin/iconv-lite/issues/13
// Reference: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
var chars = "·×";
var big5Chars = new Buffer([0xA1, 0x50, 0xA1, 0xD1]);
assert.strictEqual(iconv.toEncoding(chars, "big5").toString('binary'), big5Chars.toString('binary'));
assert.strictEqual(iconv.fromEncoding(big5Chars, "big5"), chars)
},
}).export(module)

@ -1,13 +0,0 @@
<HTML>
<HEAD>
<TITLE> meta 標籤的使用:中文網頁 </TITLE>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">
</HEAD>
<BODY>
這是一個繁體中文網頁!<br>
(This page uses big5 character set.)<br>
charset=big5
</BODY>
</HTML>

@ -1,86 +0,0 @@
var vows = require('vows'),
assert = require('assert'),
iconv = require(__dirname+'/../');
var baseStrings = {
empty: "",
hi: "Привет!",
ascii: '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f',
rus: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя",
additional1: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬\xAD®Ї°±Ііґµ¶·ё№є»јЅѕї",
additional2: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©",
additional3: " ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏ№ёђѓєѕіїјљњћќ§ўџ",
untranslatable: "£Åçþÿ¿",
};
var encodings = [{
name: "Win-1251",
variations: ['win1251', 'Windows-1251', 'windows1251', 'CP1251', 1251],
encodedStrings: {
empty: new Buffer(''),
hi: new Buffer('\xcf\xf0\xe8\xe2\xe5\xf2!', 'binary'),
ascii: new Buffer(baseStrings.ascii, 'binary'),
rus: new Buffer('\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', 'binary'),
additional1: new Buffer('\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf','binary'),
}
}, {
name: "Koi8-R",
variations: ['koi8r', 'KOI8-R', 'cp20866', 20866],
encodedStrings: {
empty: new Buffer(''),
hi: new Buffer('\xf0\xd2\xc9\xd7\xc5\xd4!', 'binary'),
ascii: new Buffer(baseStrings.ascii, 'binary'),
rus: new Buffer('\xe1\xe2\xf7\xe7\xe4\xe5\xf6\xfa\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf2\xf3\xf4\xf5\xe6\xe8\xe3\xfe\xfb\xfd\xff\xf9\xf8\xfc\xe0\xf1\xc1\xc2\xd7\xc7\xc4\xc5\xd6\xda\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd2\xd3\xd4\xd5\xc6\xc8\xc3\xde\xdb\xdd\xdf\xd9\xd8\xdc\xc0\xd1', 'binary'),
additional2: new Buffer('\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf', 'binary'),
}
}, {
name: "ISO 8859-5",
variations: ['iso88595', 'ISO-8859-5', 'ISO 8859-5', 'cp28595', 28595],
encodedStrings: {
empty: new Buffer(''),
hi: new Buffer('\xbf\xe0\xd8\xd2\xd5\xe2!', 'binary'),
ascii: new Buffer(baseStrings.ascii, 'binary'),
rus: new Buffer('\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef', 'binary'),
additional3: new Buffer('\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', 'binary'),
}
}];
var testsBatch = {};
encodings.forEach(function(encoding) {
var enc = encoding.variations[0];
var key = "hi";
var tests = {
"Convert to empty buffer": function() {
assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary'));
},
"Convert from empty buffer": function() {
assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), "");
},
"Convert from buffer": function() {
for (var key in encoding.encodedStrings)
assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc),
baseStrings[key]);
},
"Convert to buffer": function() {
for (var key in encoding.encodedStrings)
assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'),
encoding.encodedStrings[key].toString('binary'));
},
"Try different variations of encoding": function() {
encoding.variations.forEach(function(enc) {
assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), baseStrings[key]);
assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary'));
});
},
"Untranslatable chars are converted to defaultCharSingleByte": function() {
var expected = baseStrings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join('');
assert.strictEqual(iconv.toEncoding(baseStrings.untranslatable, enc).toString('binary'), expected); // Only '?' characters.
}
};
testsBatch[encoding.name+":"] = tests;
});
vows.describe("Test Cyrillic encodings").addBatch(testsBatch).export(module);

@ -1,38 +0,0 @@
var vows = require('vows'),
fs = require('fs'),
assert = require('assert'),
iconv = require(__dirname+'/../');
var testString = "中国abc",//unicode contains GBK-code and ascii
testStringGBKBuffer = new Buffer([0xd6,0xd0,0xb9,0xfa,0x61,0x62,0x63]);
vows.describe("GBK tests").addBatch({
"Vows is working": function() {},
"Return values are of correct types": function() {
assert.ok(iconv.toEncoding(testString, "utf8") instanceof Buffer);
var s = iconv.fromEncoding(new Buffer(testString), "utf8");
assert.strictEqual(Object.prototype.toString.call(s), "[object String]");
},
"GBK correctly encoded/decoded": function() {
assert.strictEqual(iconv.toEncoding(testString, "GBK").toString('binary'), testStringGBKBuffer.toString('binary'));
assert.strictEqual(iconv.fromEncoding(testStringGBKBuffer, "GBK"), testString);
},
"GB2312 correctly encoded/decoded": function() {
assert.strictEqual(iconv.toEncoding(testString, "GB2312").toString('binary'), testStringGBKBuffer.toString('binary'));
assert.strictEqual(iconv.fromEncoding(testStringGBKBuffer, "GB2312"), testString);
},
"GBK file read decoded,compare with iconv result": function() {
var contentBuffer = fs.readFileSync(__dirname+"/gbkFile.txt");
var str = iconv.fromEncoding(contentBuffer, "GBK");
var iconvc = new (require('iconv').Iconv)('GBK','utf8');
assert.strictEqual(iconvc.convert(contentBuffer).toString(), str);
},
"GBK correctly decodes and encodes characters · and ×": function() {
// https://github.com/ashtuchkin/iconv-lite/issues/13
// Reference: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT
var chars = "·×";
var gbkChars = new Buffer([0xA1, 0xA4, 0xA1, 0xC1]);
assert.strictEqual(iconv.toEncoding(chars, "GBK").toString('binary'), gbkChars.toString('binary'));
assert.strictEqual(iconv.fromEncoding(gbkChars, "GBK"), chars)
},
}).export(module)

@ -1,14 +0,0 @@
<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><title>百度一下,你就知道 </title><style>html{overflow-y:auto}body{font:12px arial;text-align:center;background:#fff}body,p,form,ul,li{margin:0;padding:0;list-style:none}body,form,#fm{position:relative}td{text-align:left}img{border:0}a{color:#00c}a:active{color:#f60}#u{padding:7px 10px 3px 0;text-align:right}#m{width:680px;margin:0 auto}#nv{font-size:16px;margin:0 0 4px;text-align:left;text-indent:117px}#nv a,#nv b,.btn,#lk{font-size:14px}#fm{padding-left:90px;text-align:left}#kw{width:404px;height:22px;padding:4px 7px;padding:6px 7px 2px\9;font:16px arial;background:url(http://www.baidu.com/img/i-1.0.0.png) no-repeat -304px 0;_background-attachment:fixed;border:1px solid #cdcdcd;border-color:#9a9a9a #cdcdcd #cdcdcd #9a9a9a;vertical-align:top}.btn{width:95px;height:32px;padding:0;padding-top:2px\9;border:0;background:#ddd url(http://www.baidu.com/img/i-1.0.0.png) no-repeat;cursor:pointer}.btn_h{background-position:-100px 0}#kw,.btn_wr{margin:0 5px 0 0}.btn_wr{width:97px;height:34px;display:inline-block;background:url(http://www.baidu.com/img/i-1.0.0.png) no-repeat -202px 0;_top:1px;*position:relative}#lk{margin:33px 0}#lk span{font:14px "宋体"}#lm{height:60px}#lh{margin:16px 0 5px;word-spacing:3px}.tools{position:absolute;top:-4px;*top:10px;right:-13px;}#mHolder{width:62px;position:relative;z-index:296;display:none}#mCon{height:18px;line-height:18px;position:absolute;cursor:pointer;padding:0 18px 0 0;background:url(http://www.baidu.com/img/bg-1.0.0.gif) no-repeat right -134px;background-position:right -136px\9}#mCon span{color:#00c;cursor:default;display:block}#mCon .hw{text-decoration:underline;cursor:pointer}#mMenu{width:56px;border:1px solid #9a99ff;list-style:none;position:absolute;right:7px;top:28px;display:none;background:#fff}#mMenu a{width:100%;height:100%;display:block;line-height:22px;text-indent:6px;text-decoration:none}#mMenu a:hover{background:#d9e1f6}#mMenu .ln{height:1px;background:#ccf;overflow:hidden;margin:2px;font-size:1px;line-height:1px}#cp,#cp a{color:#77c}#seth{display:none;behavior:url(#default#homepage)}#setf{display:none}</style>
</head>
<body><div id="u"><a href="http://www.baidu.com/gaoji/preferences.html" name="tj_setting">搜索设置</a>&nbsp;|&nbsp;<a href="http://passport.baidu.com/?login&tpl=mn" name="tj_login">登录</a></div>
<div id="m"><p id="lg"><img src="http://www.baidu.com/img/baidu_sylogo1.gif" width="270" height="129" usemap="#mp"><map name="mp"><area shape="rect" coords="40,25,230,95" href="http://hi.baidu.com/baidu/" target="_blank" title="点此进入 百度的空间" ></map></p><p id="nv"><a href="http://news.baidu.com">新&nbsp;闻</a> <b>网&nbsp;页</b> <a href="http://tieba.baidu.com">贴&nbsp;吧</a> <a href="http://zhidao.baidu.com">知&nbsp;道</a> <a href="http://mp3.baidu.com">MP3</a> <a href="http://image.baidu.com">图&nbsp;片</a> <a href="http://video.baidu.com">视&nbsp;频</a> <a href="http://map.baidu.com">地&nbsp;图</a></p><div id="fm"><form name="f" action="/s"><input type="text" name="wd" id="kw" maxlength="100"><input type="hidden" name="rsv_bp" value="0"><input type="hidden" name="rsv_spt" value="3"><span class="btn_wr"><input type="submit" value="百度一下" id="su" class="btn" onmousedown="this.className='btn btn_h'" onmouseout="this.className='btn'"></span></form><span class="tools"><span id="mHolder"><div id="mCon"><span>输入法</span></div></span></span><ul id="mMenu"><li><a href="#" name="ime_hw">手写</a></li><li><a href="#" name="ime_py">拼音</a></li><li class="ln"></li><li><a href="#" name="ime_cl">关闭</a></li></ul></div>
<p id="lk"><a href="http://hi.baidu.com">空间</a> <a href="http://baike.baidu.com">百科</a> <a href="http://www.hao123.com">hao123</a><span> | <a href="/more/">更多&gt;&gt;</a></span></p><p id="lm"></p><p><a id="seth" onClick="this.setHomePage('http://www.baidu.com')" href="http://utility.baidu.com/traf/click.php?id=215&url=http://www.baidu.com" onmousedown="return ns_c({'fm':'behs','tab':'homepage','pos':0})">把百度设为主页</a><a id="setf" onClick="fa(this)" href="javascript:void(0)" onmousedown="return ns_c({'fm':'behs','tab':'favorites','pos':0})">把百度加入收藏夹</a></p>
<p id="lh"><a href="http://e.baidu.com/?refer=888">加入百度推广</a> | <a href="http://top.baidu.com">搜索风云榜</a> | <a href="http://home.baidu.com">关于百度</a> | <a href="http://ir.baidu.com">About Baidu</a></p><p id="cp">&copy;2011 Baidu <a href="/duty/">使用百度前必读</a> <a href="http://www.miibeian.gov.cn" target="_blank">京ICP证030173号</a> <img src="http://gimg.baidu.com/img/gs.gif"></p></div></body>
<script>var w=window,d=document,n=navigator,k=d.f.wd,a=d.getElementById("nv").getElementsByTagName("a"),isIE=n.userAgent.indexOf("MSIE")!=-1&&!window.opera;for(var i=0;i<a.length;i++){a[i].onclick=function(){if(k.value.length>0){var C=this,A=C.href,B=encodeURIComponent(k.value);if(A.indexOf("q=")!=-1){C.href=A.replace(/q=[^&\x24]*/,"q="+B)}else{this.href+="?q="+B}}}}(function(){if(/q=([^&]+)/.test(location.search)){k.value=decodeURIComponent(RegExp["\x241"])}})();if(n.cookieEnabled&&!/sug?=0/.test(d.cookie)){d.write("<script src=http://www.baidu.com/js/bdsug.js?v=1.0.3.0><\/script>")}function addEV(C,B,A){if(w.attachEvent){C.attachEvent("on"+B,A)}else{if(w.addEventListener){C.addEventListener(B,A,false)}}}function G(A){return d.getElementById(A)}function ns_c(E){var F=encodeURIComponent(window.document.location.href),D="",A="",B="",C=window["BD_PS_C"+(new Date()).getTime()]=new Image();for(v in E){A=E[v];D+=v+"="+A+"&"}B="&mu="+F;C.src="http://nsclick.baidu.com/v.gif?pid=201&pj=www&"+D+"path="+F+"&t="+new Date().getTime();return true}if(/\bbdime=[12]/.test(d.cookie)){document.write("<script src=http://www.baidu.com/cache/ime/js/openime-1.0.0.js><\/script>")}(function(){var B=G("user"),A=G("userMenu");if(B&&A){addEV(B,"click",function(C){A.style.display=A.style.display=="block"?"none":"block";window.event?C.cancelBubble=true:C.stopPropagation()});addEV(document,"click",function(){A.style.display="none"})}})();(function(){var E=G("u").getElementsByTagName("a"),C=G("nv").getElementsByTagName("a"),I=G("lk").getElementsByTagName("a"),B="";var A=["news","tieba","zhidao","mp3","img","video","map"];var H=["hi","baike","hao123","more"];if(G("un")&&G("un").innerHTML!=""){B=G("un").innerHTML}function D(J){addEV(J,"mousedown",function(L){var L=L||window.event;var K=L.target||L.srcElement;ns_c({fm:"behs",tab:K.name||"tj_user",un:encodeURIComponent(B)})})}for(var F=0;F<E.length;F++){D(E[F])}for(var F=0;F<C.length;F++){C[F].name="tj_"+A[F];D(C[F])}for(var F=0;F<I.length;F++){I[F].name="tj_"+H[F];D(I[F])}})();addEV(w,"load",function(){k.focus()});w.onunload=function(){};</script>
<script type="text/javascript" src="http://www.baidu.com/cache/hps/js/hps-1.2.js"></script>
</html><!--b762345d979562e8-->

@ -1,79 +0,0 @@
var vows = require('vows'),
assert = require('assert'),
iconv = require(__dirname+'/../');
var baseStrings = {
empty: "",
hi: "Γειά!",
ascii: '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f',
greek: "αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩάέήίόύώΆΈΉΊΌΎΏϊϋΪΫ",
untranslatable: "Åçþÿ¿"
};
var encodings = [{
name: "windows1253",
variations: ['windows-1253', 'win-1253', 'win1253', 'cp1253', 'cp-1253', 1253],
encodedStrings: {
empty: new Buffer(''),
hi: new Buffer('\xc3\xe5\xe9\xdc!', 'binary'),
ascii: new Buffer(baseStrings.ascii, 'binary'),
greek: new Buffer('\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xdc\xdd\xde\xdf\xfc\xfd\xfe\xa2\xb8\xb9\xba\xbc\xbe\xbf\xfa\xfb\xda\xdb', 'binary'),
}
}, {
name: "iso88597",
variations: ['iso-8859-7', 'greek', 'greek8', 'cp28597', 'cp-28597', 28597],
encodedStrings: {
empty: new Buffer(''),
hi: new Buffer('\xc3\xe5\xe9\xdc!', 'binary'),
ascii: new Buffer(baseStrings.ascii, 'binary'),
greek: new Buffer('\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xdc\xdd\xde\xdf\xfc\xfd\xfe\xb6\xb8\xb9\xba\xbc\xbe\xbf\xfa\xfb\xda\xdb', 'binary'),
}
}, {
name: "cp737",
variations: ['cp-737', 737],
encodedStrings: {
empty: new Buffer(''),
hi: new Buffer('\x82\x9c\xa0\xe1!', 'binary'),
ascii: new Buffer(baseStrings.ascii, 'binary'),
greek: new Buffer('\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xab\xac\xad\xae\xaf\xe0\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\xe1\xe2\xe3\xe5\xe6\xe7\xe9\xea\xeb\xec\xed\xee\xef\xf0\xe4\xe8\xf4\xf5', 'binary'),
}
}];
var testsBatch = {};
encodings.forEach(function(encoding) {
var enc = encoding.variations[0];
var key = "hi";
var tests = {
"Convert to empty buffer": function() {
assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary'));
},
"Convert from empty buffer": function() {
assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), "");
},
"Convert from buffer": function() {
for (var key in encoding.encodedStrings)
assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc),
baseStrings[key]);
},
"Convert to buffer": function() {
for (var key in encoding.encodedStrings)
assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'),
encoding.encodedStrings[key].toString('binary'));
},
"Try different variations of encoding": function() {
encoding.variations.forEach(function(enc) {
assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), baseStrings[key]);
assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary'));
});
},
"Untranslatable chars are converted to defaultCharSingleByte": function() {
var expected = baseStrings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join('');
assert.strictEqual(iconv.toEncoding(baseStrings.untranslatable, enc).toString('binary'), expected); // Only '?' characters.
}
};
testsBatch[encoding.name+":"] = tests;
});
vows.describe("Test Greek encodings").addBatch(testsBatch).export(module);

@ -1,55 +0,0 @@
var vows = require('vows'),
assert = require('assert'),
iconv = require(__dirname+'/../');
var testString = "Hello123!";
var testStringLatin1 = "Hello123!£Å÷×çþÿ¿®";
var testStringBase64 = "SGVsbG8xMjMh";
vows.describe("Generic UTF8-UCS2 tests").addBatch({
"Vows is working": function() {},
"Return values are of correct types": function() {
assert.ok(iconv.toEncoding(testString, "utf8") instanceof Buffer);
var s = iconv.fromEncoding(new Buffer(testString), "utf8");
assert.strictEqual(Object.prototype.toString.call(s), "[object String]");
},
"Internal encodings all correctly encoded/decoded": function() {
['utf8', "UTF-8", "UCS2", "binary", ""].forEach(function(enc) {
assert.strictEqual(iconv.toEncoding(testStringLatin1, enc).toString(enc), testStringLatin1);
assert.strictEqual(iconv.fromEncoding(new Buffer(testStringLatin1, enc), enc), testStringLatin1);
});
},
"Base64 correctly encoded/decoded": function() {
assert.strictEqual(iconv.toEncoding(testStringBase64, "base64").toString("binary"), testString);
assert.strictEqual(iconv.fromEncoding(new Buffer(testString, "binary"), "base64"), testStringBase64);
},
"Latin1 correctly encoded/decoded": function() {
assert.strictEqual(iconv.toEncoding(testStringLatin1, "latin1").toString("binary"), testStringLatin1);
assert.strictEqual(iconv.fromEncoding(new Buffer(testStringLatin1, "binary"), "latin1"), testStringLatin1);
},
"Convert from string, not buffer (binary encoding used)": function() {
assert.strictEqual(iconv.fromEncoding(testStringLatin1, "binary"), testStringLatin1);
},
"Convert to string, not buffer (utf8 used)": function() {
var res = iconv.toEncoding(new Buffer(testStringLatin1, "utf8"));
assert.ok(res instanceof Buffer);
assert.strictEqual(res.toString("utf8"), testStringLatin1);
},
"Throws on unknown encodings": function() {
assert.throws(function() { iconv.toEncoding("a", "xxx"); });
assert.throws(function() { iconv.fromEncoding("a", "xxx"); });
},
"Convert non-strings and non-buffers": function() {
assert.strictEqual(iconv.toEncoding({}, "utf8").toString(), "[object Object]");
assert.strictEqual(iconv.toEncoding(10, "utf8").toString(), "10");
assert.strictEqual(iconv.toEncoding(undefined, "utf8").toString(), "");
assert.strictEqual(iconv.fromEncoding({}, "utf8"), "[object Object]");
assert.strictEqual(iconv.fromEncoding(10, "utf8"), "10");
assert.strictEqual(iconv.fromEncoding(undefined, "utf8"), "");
},
"Aliases encode and decode work the same as toEncoding and fromEncoding": function() {
assert.strictEqual(iconv.toEncoding(testString, "latin1").toString("binary"), iconv.encode(testString, "latin1").toString("binary"));
assert.strictEqual(iconv.fromEncoding(testStringLatin1, "latin1"), iconv.decode(testStringLatin1, "latin1"));
},
}).export(module)

@ -1,67 +0,0 @@
var iconv = require('iconv');
var iconv_lite = require("../index");
var encoding = process.argv[2] || "windows-1251";
var convertTimes = 10000;
var encodingStrings = {
'windows-1251': 'This is a test string 32 chars..',
'gbk': '这是中文字符测试。。!@¥%12',
'utf8': '这是中文字符测试。。!@¥%12This is a test string 48 chars..',
};
// Test encoding.
var str = encodingStrings[encoding];
if (!str) {
throw new Error('Don\'t support ' + encoding + ' performance test.');
}
for (var i = 0; i < 13; i++) {
str = str + str;
}
console.log('\n' + encoding + ' charset performance test:');
console.log("\nEncoding "+str.length+" chars "+convertTimes+" times:");
var start = Date.now();
var converter = new iconv.Iconv("utf8", encoding);
for (var i = 0; i < convertTimes; i++) {
var b = converter.convert(str);
}
var duration = Date.now() - start;
var mbs = convertTimes*b.length/duration/1024;
console.log("iconv: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s.");
var start = Date.now();
for (var i = 0; i < convertTimes; i++) {
var b = iconv_lite.encode(str, encoding);
}
var duration = Date.now() - start;
var mbs = convertTimes*b.length/duration/1024;
console.log("iconv-lite: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s.");
// Test decoding.
var buf = iconv_lite.encode(str, encoding);
console.log("\nDecoding "+buf.length+" bytes "+convertTimes+" times:");
var start = Date.now();
var converter = new iconv.Iconv(encoding, "utf8");
for (var i = 0; i < convertTimes; i++) {
var s = converter.convert(buf).toString();
}
var duration = Date.now() - start;
var mbs = convertTimes*buf.length/duration/1024;
console.log("iconv: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s.");
var start = Date.now();
for (var i = 0; i < convertTimes; i++) {
var s = iconv_lite.decode(buf, encoding);
}
var duration = Date.now() - start;
var mbs = convertTimes*buf.length/duration/1024;
console.log("iconv-lite: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s.");

@ -1,90 +0,0 @@
var vows = require('vows'),
assert = require('assert'),
iconv = require(__dirname+'/../');
var ascii = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f';
var encodings = [{
name: "windows1254",
variations: ['windows-1254', 'win-1254', 'win1254', 'cp1254', 'cp-1254', 1254],
strings: {
empty: "",
ascii: ascii,
turkish: "€‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ",
untranslatable: "\x81\x8d\x8e\x8f\x90\x9d\x9e"
},
encodedStrings: {
empty: new Buffer(''),
ascii: new Buffer(ascii, 'binary'),
turkish: new Buffer(
'\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c' +
'\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9f' +
'\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xae\xaf' +
'\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf' +
'\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf' +
'\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' +
'\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef' +
'\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff',
'binary'),
}
}, {
name: "iso88599",
variations: ['iso-8859-9', 'turkish', 'turkish8', 'cp28599', 'cp-28599', 28599],
strings: {
empty: "",
ascii: ascii,
turkish: "\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ",
untranslatable: ''
},
encodedStrings: {
empty: new Buffer(''),
ascii: new Buffer(ascii, 'binary'),
turkish: new Buffer(
'\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf' +
'\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf' +
'\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf' +
'\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' +
'\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef' +
'\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff',
'binary')
}
}];
var testsBatch = {};
encodings.forEach(function(encoding) {
var enc = encoding.variations[0];
var key = "turkish";
var tests = {
"Convert to empty buffer": function() {
assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary'));
},
"Convert from empty buffer": function() {
assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), "");
},
"Convert from buffer": function() {
for (var key in encoding.encodedStrings)
assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc),
encoding.strings[key]);
},
"Convert to buffer": function() {
for (var key in encoding.encodedStrings)
assert.strictEqual(iconv.toEncoding(encoding.strings[key], enc).toString('binary'),
encoding.encodedStrings[key].toString('binary'));
},
"Try different variations of encoding": function() {
encoding.variations.forEach(function(enc) {
assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), encoding.strings[key]);
assert.strictEqual(iconv.toEncoding(encoding.strings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary'));
});
},
"Untranslatable chars are converted to defaultCharSingleByte": function() {
var expected = encoding.strings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join('');
assert.strictEqual(iconv.toEncoding(encoding.strings.untranslatable, enc).toString('binary'), expected); // Only '?' characters.
}
};
testsBatch[encoding.name+":"] = tests;
});
vows.describe("Test Turkish encodings").addBatch(testsBatch).export(module);

@ -3,7 +3,7 @@ var EventEmitter = require('events').EventEmitter,
inherits = require('util').inherits,
inspect = require('util').inspect,
utf7 = require('utf7').imap,
iconv = require('../deps/iconv-lite'),
iconv = require('iconv-lite'),
jsencoding/*lazy-loaded*/;
var CH_LF = 10,

@ -5,6 +5,7 @@
"main": "./lib/Connection",
"dependencies": {
"utf7": "1.0.0",
"iconv-lite": "0.2.11",
"readable-stream": "1.0.2"
},
"scripts": {

Loading…
Cancel
Save