Created
May 26, 2013 04:32
-
-
Save heroicyang/5651716 to your computer and use it in GitHub Desktop.
“清华大学一名男生给女生写的明信片”之Node解码版
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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