Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
UTF-8 encoder and decoder for Node
JavaScript C++ Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
benchmark.js
binding.gyp
package.json
wtf8.cc
wtf8.js

README.md

WTF8 Build Status

A UTF-8 decoder and encoder which can handle characters outside Basic Multilingual Plane for node.js. It's also reasonably fast.

Why?

V8 doesn't like 4-byte UTF-8 characters. 😞

Methods

.decode(buffer)

Decode buffer containing UTF-8 data to JS string.

var utf8 = require('wtf8');
utf8.decode(new Buffer([0x68, 0x65, 0x6c, 0x6c, 0x6f]));
// => 'hello'

.encode(string)

Encode strings to buffer.

var utf8 = require('wtf8');
utf8.encode('hello');
// => <SlowBuffer 68 65 6c 6c 6f>

TODO

  • stream piping
Something went wrong with that request. Please try again.