pure javascript character encoding conversion
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
table
LICENSE
README.md
index.js
package.json

README.md

iconv-js - pure javascript character encoding conversion

Supported encodings

  • SJIS(win) <-> UTF8

Usage

Node.js

I recommend that you use jconv instead of this module.

var iconv = require('iconv-js');

// Convert from SJIS buffer to UTF8 buffer.
utf8_buffer = iconv.fromSJIS(sjis_buffer);

// Convert from UTF8 buffer to SJIS buffer.
sjis_buffer = iconv.toSJIS(utf8_buffer);

Browser

I recommend that you use Web Encoding API instead of this module.

<script src="iconv-js/index.js"></script>
<script src="iconv-js/table/sjis-uni.js"></script>
<script>

var iconv = iconv_js.init();
        
// Convert from SJIS arraybuffer to UTF8 arraybuffer.
utf8_arraybuffer = iconv.fromSJIS(sjis_arraybuffer);

// Convert from UTF8 arraybuffer to SJIS arraybuffer.
sjis_arraybuffer = iconv.toSJIS(utf8_arraybuffer);

</script>