How can I convert a string into a unicode character?
String.fromCharCode("0x" + input)
or
String.fromCharCode(parseInt(input, 16))
as they are 16bit numbers (UTF-16)
Use String.fromCharCode()
like this: String.fromCharCode(parseInt(input,16))
. When you put a Unicode value in a string using \u
, it is interpreted as a hexdecimal value, so you need to specify the base (16) when using parseInt
.