This pages shows you how to use JavaScript to find a character's Unicode number (called codepoint), and how to get a Unicode char from its codepoint. Also, how to convert from/to decimal and hexadecimal.
Use this: ‹string›.charCodeAt(‹index›). Example:
// get a Unicode char's codepoint "α".charCodeAt(0) // returns 945
(945 (decimal) is the codepoint for GREEK SMALL LETTER ALPHA α.)
test here: JavaScript Unicode codepoint test
reference https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/charCodeAt
Use this: String.fromCharCode(‹n1›, ‹n2›, …), where the ‹n› are codepoints in decimal. It returns a string. Example:
String.fromCharCode(945, 946) // returns "αβ"
test: JavaScript test: Unicode codepoint to char
reference https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode
// convert decimal to hex (10).toString(16) // returns "a"
test JavaScript test: decimal to hex
// convert hexadecimal (string) to decimal parseInt("a", 16); // returns 10blog comments powered by Disqus