Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Out of service — Character set transcoder for NodeJS, built on libiconv
C++ Python JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
src
CHANGES
LICENSE
Makefile
README
package.json
test.js
wscript

README

Provides an interface for encoding and decoding
among character sets.

    var Transcoder = require("transcode").Transcoder;
    var Buffer = require("buffer").Buffer;
    var transcoder = new Transcoder(sourceCharset, targetCharset)
    var state = {
        "source": new Buffer(10),
        "target": new Buffer(10)
    };
    transcoder.transcode(state);

The state object can be initialized with and may be updated to include:

 - source: the source buffer
 - target: the target buffer
 - sourceStart: the read head, defaults to 0
 - sourceStop: the read boundary, defaults to start.length
 - targetStart: the write head, defaults to 0
 - targetStop: the write boundary, defaults to target.length
 - error: an error message, if one occurs, one of:
    - "resize"
    - "invalid"
    - "incomplete"
 - message: human readable form of the error
 - nonReversible: an accumulator for non-reversible character
   conversions

Something went wrong with that request. Please try again.