I have this Unicode character that I want to display using the new Unicode Point Escapes (i.e.e where someone uses '\u{Code Point Here}'
However, I must be doing something wrong because doing
console.log('\u{134069}');
returns:
Uncaught SyntaxError: Undefined Unicode code-point
But using
console.log('\ud842\udfb5')
returns the (correct)
𠮵
How can I use the code point escape?
Unicode escape sequences in Javascript use hexadecimal digits to represent codepoints (which makes sense, given they are very typically represented this way). You have tried to use 134069, which, based on the surrogate pair you've supplied, is actually the decimal representation of the codepoint you're wanting to print. You'll need use hex equivalent instead, e.g. \u{20BB5} in ES6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With