简体   繁体   中英

Convert Decimal to Hex or Unicode using Javascript

the problem i'm facing is when i inputting emoji from an android device to display on a browser, the emoji is converted its form of Decimal code like 💙 💙 💙 💙 💙 💙 . is there any way to detect the decimal code then convert it to Hex or Unicode with javascript? because with Hashtag in front of the number, it might lead to confusion as hashtag input.

I've used the toString() method but it doesn't seem to solve the problem

decimalNumber.toString( radix )

也许使用\\u----其中 ---- 是十六进制代码(在 utf8 字符串中)?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM