Skip to content

Instantly share code, notes, and snippets.

@Ravenstine
Created February 10, 2015 23:47
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 Ravenstine/e188935801a0f60150e6 to your computer and use it in GitHub Desktop.
Save Ravenstine/e188935801a0f60150e6 to your computer and use it in GitHub Desktop.
charcode_to_unicode_hex.js
function charCodeToUnicodeHex(code) {
var codeHex = code.toString(16).toUpperCase();
while (codeHex.length < 4) {
codeHex = "0" + codeHex;
}
return "0x" + codeHex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment