Skip to content

Instantly share code, notes, and snippets.

@baudehlo
Created October 25, 2011 19:36
Show Gist options
  • Save baudehlo/1313970 to your computer and use it in GitHub Desktop.
Save baudehlo/1313970 to your computer and use it in GitHub Desktop.
var bodyText = "Test for chinese\n人民网10月20日电 (安国章) 据来自利比亚的消息,\n利比亚执政当局部队今天已经完全控制了卡扎菲的老家苏尔特,卡扎菲两腿受伤后被逮捕,已被送往医院。 据利比亚电视台报道,利比亚执政当局的部队今天清晨对卡 ...";
console.log("Char: " + bodyText[45] + ", charcode: " + bodyText.charCodeAt(45));
$ node /tmp/charcodeat.js
Char: 利, charcode: 21033
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment