Wrestling with Surrogate pairs for Unicode

Something you want to see in a LiveCode product? Want a new forum set up for a specific topic? Talk about it here.

Moderator: Klaus

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10433
Joined: Fri Feb 19, 2010 10:17 am

Wrestling with Surrogate pairs for Unicode

Post by richmond62 »

No longer, thanks to the good offices of Scott Rossi:
Spairs.png
SP.zip
capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Wrestling with Surrogate pairs for Unicode

Post 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!
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10433
Joined: Fri Feb 19, 2010 10:17 am

Re: Wrestling with Surrogate pairs for Unicode

Post 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 288 times
Many thanks to Alejandro Tejada for pointing out there was a problem.
DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Contact:

Re: Wrestling with Surrogate pairs for Unicode

Post 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.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10433
Joined: Fri Feb 19, 2010 10:17 am

Re: Wrestling with Surrogate pairs for Unicode

Post by richmond62 »

That has got to be good :)

Roll on a stable version of 7.0.
Post Reply