0.0.0 • Published 10 years ago

strbuf v0.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

strbuf

convert a buffer with is own charset

var strbuf = require('strbuf');

fs.readFile('/path/to/file', function(error, data){
  if(error){
    throw error;
  }
  
  console.log(strbuf(data));
});

or simply

// "中文abc";
var big5Buffer = new Buffer([0xa4,0xa4,0xa4,0xe5,0x61,0x62,0x63]),
console.log(strbuf(big5Buffer));
==> 中文abc