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.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

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

Wrestling with Surrogate pairs for Unicode

Post by richmond62 » Sat May 17, 2014 7:54 pm

No longer, thanks to the good offices of Scott Rossi:
Spairs.png
SP.zip

capellan
Posts: 666
Joined: Wed Aug 15, 2007 11:09 pm

Re: Wrestling with Surrogate pairs for Unicode

Post by capellan » Sat May 17, 2014 8:45 pm

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: 5890
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Wrestling with Surrogate pairs for Unicode

Post by richmond62 » Sun May 18, 2014 12:08 pm

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 138 times
Many thanks to Alejandro Tejada for pointing out there was a problem.

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: Wrestling with Surrogate pairs for Unicode

Post by DarScott » Sun May 18, 2014 11:38 pm

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: 5890
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Wrestling with Surrogate pairs for Unicode

Post by richmond62 » Mon May 19, 2014 7:32 pm

That has got to be good :)

Roll on a stable version of 7.0.

Post Reply

Return to “Feature Proposals”