Page 1 of 1

Wrestling with Surrogate pairs for Unicode

Posted: Sat May 17, 2014 7:54 pm
by richmond62
No longer, thanks to the good offices of Scott Rossi:
Spairs.png
SP.zip

Re: Wrestling with Surrogate pairs for Unicode

Posted: Sat May 17, 2014 8:45 pm
by capellan
Hi Richmond,

I visited this webpage:
http://www.russellcottrell.com/greek/ut ... ulator.htm
and tested the webpage results against your stack.

Why your stack shows this result?

Enter Pair Numbers here
55241 + 56228 = 9124

Enter Unicode address here
10012 = 55241 + 56228

Thanks in advance!

Re: Wrestling with Surrogate pairs for Unicode

Posted: Sun May 18, 2014 12:08 pm
by richmond62
Confession Time:

"MOD 104" is NOT "MOD 1024"

entirely my fault.

Sorry.

New version here, including something to catch Unicode addresses below Hex 10000:
Spairs2.png
SP2.zip
(13.25 KiB) Downloaded 182 times
Many thanks to Alejandro Tejada for pointing out there was a problem.

Re: Wrestling with Surrogate pairs for Unicode

Posted: Sun May 18, 2014 11:38 pm
by DarScott
With LiveCode 7 you will be able to access code points and (probably) code units. Even if code units are awkward, it would still be possible to get the textEncoding(). The computation will be both less important and easier.

Re: Wrestling with Surrogate pairs for Unicode

Posted: Mon May 19, 2014 7:32 pm
by richmond62
That has got to be good :)

Roll on a stable version of 7.0.