Skip to content

Instantly share code, notes, and snippets.

@moluapple
Last active September 18, 2017 14:01
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 moluapple/62feb5be576ee124452c126659384a6f to your computer and use it in GitHub Desktop.
Save moluapple/62feb5be576ee124452c126659384a6f to your computer and use it in GitHub Desktop.
GBK 乱码 fix
function GBKDecode(str) {
var f = File('gbk.txt'), gbk;
f.encoding = 'BINARY';
f.open('w'), f.write(str), f.close();
f.encoding = 'GBK';
f.open('r');
gbk = f.read();
f.close(), f.remove();
return gbk
}
var inks = activeDocument.inkList,
arr = [],
i = 0;
for (; i < inks.length; i++) {
arr.push(inks[i].name)
}
alert(GBKDecode(arr.join('\r')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment