Skip to content

jnath/strbuf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

convert buffet to is own charset

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published