Page 1 of 1

Extracting an UTF8 char number with Tilde [SOLVED]

Posted: Tue Apr 01, 2014 12:31 pm
by atout66
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.

Re: Extracting an UTF8 char number with Tilde

Posted: Wed Apr 02, 2014 10:03 am
by atout66
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.

Re: Extracting an UTF8 char number with Tilde

Posted: Wed Apr 02, 2014 1:24 pm
by dave.kilroy
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

Re: Extracting an UTF8 char number with Tilde

Posted: Wed Apr 02, 2014 1:49 pm
by atout66
Thanks Dave for your link. I give it a look right now. :wink:

Re: Extracting an UTF8 char number with Tilde

Posted: Wed Apr 02, 2014 4:34 pm
by bn
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

Re: Extracting an UTF8 char number with Tilde

Posted: Wed Apr 02, 2014 5:21 pm
by atout66
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.