wtf8
A Node.JS UTF-8 encoder and decoder which is able to handle characters outside Basic Multilingual Plane
Last updated 11 years ago by lautis .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install wtf8 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.2.0                                ...           latest (11 years ago)

3 Versions

  • 0.2.0                                ...           11 years ago
  • 0.1.1                                ...           14 years ago
  • 0.1.0                                ...           14 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 3
Last Month 3
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |