Extracting an UTF8 char number with Tilde [SOLVED]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm
Location: France

Extracting an UTF8 char number with Tilde [SOLVED]

Post by atout66 » Tue Apr 01, 2014 12:31 pm

Hi to all,

I have a field in which there are two UTF8 chars: <ʃ> and <ɑ̃>
I have this script:

Code: Select all

on mouseUp
   set the useUnicode to true
   answer charToNum(the unicodeText of last char of fld "leTest")
...
If I ask for the FIRST char, it's OK; it returns <643> which is the correct number.
But if I ask for the LAST char <ɑ̃>, and other last chars like <ɛ̃> or <œ̃> or <ɔ̃>, I get always <771> !

Could you explain me what am I doing wrong ?
I notice that the problem occurs always with the "tilde" char...

Thanks in advance.
Last edited by atout66 on Thu Apr 03, 2014 6:54 am, edited 1 time in total.
Discovering LiveCode Community 6.5.2.

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm
Location: France

Re: Extracting an UTF8 char number with Tilde

Post by atout66 » Wed Apr 02, 2014 10:03 am

Hi to all,

If this problem can not be resolved, I would suggest that it be placed in the bug report section, what do you think?

Kind regards.
Discovering LiveCode Community 6.5.2.

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: Extracting an UTF8 char number with Tilde

Post by dave.kilroy » Wed Apr 02, 2014 1:24 pm

Hi Atout66

I think you will find it worth having a look at Fraser's latest blog posting about Unicode http://livecode.com/blog/2014/04/02/exa ... ting-text/

I see you are developing with LiveCode 6.5.2 so to be able to use the new Unicode goodness you'll have to upgrade to LC 7
"...this is not the code you are looking for..."

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm
Location: France

Re: Extracting an UTF8 char number with Tilde

Post by atout66 » Wed Apr 02, 2014 1:49 pm

Thanks Dave for your link. I give it a look right now. :wink:
Discovering LiveCode Community 6.5.2.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Extracting an UTF8 char number with Tilde

Post by bn » Wed Apr 02, 2014 4:34 pm

Hi atout,

771 is the "COMBINING TILDE"
see:
http://www.fileformat.info/info/unicode ... /index.htm

so instead of 2 you have 3 chars, the last one is the combining tilde.

Again I don't know anything about unicode.

But here is a littel stack that shows the numToChars and the html representation of
ʃɑ̃

Kind regards
Bernd
Attachments
unicodeCharToNum.livecode.zip
(1.15 KiB) Downloaded 215 times

atout66
Posts: 266
Joined: Wed Feb 02, 2011 12:31 pm
Location: France

Re: Extracting an UTF8 char number with Tilde

Post by atout66 » Wed Apr 02, 2014 5:21 pm

Thanks for your help Bernd :wink:
Your approach is very interesting.
I'm going to see how to deal with it because my upgrade with LC7 is presently not really successfull :shock:

Kind regards.
Discovering LiveCode Community 6.5.2.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”