Referring to chars by decimal or hex numbers ????

Peter W A Wood peterwawood at gmail.com
Fri Jul 10 20:40:30 EDT 2009


Richmond

> Supplementary Private Use Area-A  [not that funny place in the USA
> where aliens have been landing] starts at Unicode hex U+F0000
>
> [funny how that says 'UFO' in code. But I digress . . .]
>
> (that's 983040 in decimal numbers)
>
> so merrily tried
> set the useUnicode to true
> put numToChar(983040) into fld "SUCCESS"
>
> and fell foul of this:
>
> "If the useUnicode property is set to true, the ASCIIValue is an  
> integer between zero and 65535."
>
> BLAST!
>
> Oops:  983040 is bigger than 65535
> (had to slip in that note for people who have a problem counting up  
> to 7) . . .    :)

Your blast may be premature. Devan Asay's Unicode tutorial (http://www.runrev.com/developers/tutorials/unicode-in-revolution/ 
) says that all Unicode characters are UTF-16. In UTF-16 numbers  
greater than 65535 can be represented by a two character combination.  
It's all explained much better than I could at http://en.wikipedia.org/wiki/Utf-16

The UTF-16 sequence for the Unicode code point 983040 (decimal) is  
DB80 DC00 (Hexadecimal) ; courtesy of http://rishida.net/tools/conversion/

Regards

Peter




More information about the use-livecode mailing list