Skip to content

Instantly share code, notes, and snippets.

@heroicyang
Created May 26, 2013 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heroicyang/5651716 to your computer and use it in GitHub Desktop.
Save heroicyang/5651716 to your computer and use it in GitHub Desktop.
“清华大学一名男生给女生写的明信片”之Node解码版
var _ = require('underscore')
, iconv = require('iconv-lite');
var codes = [214,247,210,170,190,205,202,199,207,235,202,212,202,212,184,248,212,219,195,199,188,196,208,197,202,177,181,216,214,183,191,201,210,212,208,180,181,195,182,224,188,242,194,212,161,173,161,173];
var str = _.map(codes, function (code) {
return String.fromCharCode(code);
}).join('');
console.log(iconv.decode(new Buffer(str, 'ascii'), 'gbk'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment