How can I convert a string into a unicode character?

后端 未结 5 1987
庸人自扰
庸人自扰 2021-01-31 15:17

In Javascript \'\\uXXXX\' returns in a unicode character. But how can I get a unicode character when the XXXX part is a variable?

For example:<

5条回答
  •  醉酒成梦
    2021-01-31 15:29

    JavaScript uses UCS-2 internally.

    Thus, String.fromCharCode(codePoint) won’t work for supplementary Unicode characters. If codePoint is 119558 (0x1D306, for the '

提交回复
热议问题