ANSI TO UNICODE
Convert ansi buffer to character(ucs2 encodings), or convert character to ansi encodings in NodeJs.
- Faster than iconv-lite.
- Don't depend other module.
- The volume is so small.
Usage
Decode API
var fs = ;var buf = fs; //txt's encoding is ANSI, the content is "I(我) love(爱) you(你)."var a2u = ;var str newBuf; // Convert from an encoded buffer to js string.str = a2u;console;//I(我) love(爱) you(你). // If you want convert to buffer with ucs2 encoding, the second arg for method(decode) will be true.newBuf = a2u; console;console;console;//I(我) love(爱) you(你).
Encode API
var fs = ;var a2u = ;var str = "I(我) love(爱) you(你).";var buf; // If stringbuf = a2u;console; // If bufferbuf = a2u;console; // Write to filefs;