开发者

Unicode characters from charcode in javascript for charcodes > 0xFFFF

开发者 https://www.devze.com 2023-02-20 13:51 出处:网络
I need to get a string / char from a unicode charcode and finally put it into a DOM TextNode to add into an HTML page using client side JavaScript.

I need to get a string / char from a unicode charcode and finally put it into a DOM TextNode to add into an HTML page using client side JavaScript.

Currently, I am doing:

String.fromCharCode(parseInt(charcode, 16));

where charcode is a hex string containing the charcode, e.g. "1D400". The unicode character which should be returned is

0

精彩评论

暂无评论...
验证码 换一张
取 消