Page 1 of 1

unicode to hexadecimal

Posted: Fri May 03, 2019 10:12 am
by terryho
Hi All

I want to convert unicode Chinese character to hex value. I can use the following to convert english to hex value.

put charToNum("P") into tNum
answer baseConvert(tNum,10,16) ; return 70

If I use a Chinese character "δΈ­" in the above it will return "3F". which is not correct. The correct value is "\u4E2D".

Please advise how can I make it!

Regards

Terry Ho

Re: unicode to hexadecimal

Posted: Fri May 03, 2019 10:25 am
by Klaus
Ni hao Terry,

just guessing, but maybe using something like codepointtonum() etc. will do the job?
CHARTONUM() has been deprecated with the introduction of Unicode.


Best

Klaus

Re: unicode to hexadecimal

Posted: Sat May 04, 2019 5:50 am
by terryho
Hi Klaus,

Thanks your help. It is working.

Regards

Terry Ho