doublebyte chars

Slava Paperno slava at lexiconbridge.com
Sun Jun 12 10:42:19 CDT 2011


In my first response I suggested you use "word N of the unicodeText of field
MyFiled." I still recommend that.

Instead of manipulating the fields, as you would with single-byte text, I
suggest you put their unicodeText into variables, use the uniDecode(MyVar,
"UTF8") function to convert the variables to UTF8 and then manipulate the
UTF8 text in the variables. When you need to see the text, convert it back
to UTF16 using uniEncode(MyVar, "UTF8") and assign that to the unicodeText
of field MyField.

Slava

> -----Original Message-----
> From: use-livecode-bounces at lists.runrev.com [mailto:use-livecode-
> bounces at lists.runrev.com] On Behalf Of Lars Brehmer
> Sent: Sunday, June 12, 2011 11:03 AM
> To: use-livecode at lists.runrev.com
> Subject: re: doublebyte chars
> 
> Thanks for the suggestions, but I am still completely baffled. (I
> noticed that Russian text didn't display in the newsletter)
> 
> I looked and Devin's tutorial and experimented a little bit.
> 
> Two fields, both "arial,russian"
> 
> In the first (fld "q1") I typed in Russian "menya zovut" (I am called,
> or they call me)
> 
> In the second (fld "q2") I typed in Russian "zovut menya" - the same
> two words in reverse order.
> 
> set the useUnicode to true
> put chartonum(char 1 to 2 in fld "q1") - returns 1084
> 
> set the useUnicode to true
> put chartonum(char 1 to 2 in fld "q1") - returns 1079
> 
> So far so good. However, I repeated this with the first letter in the
> second word in each field. Shouldn't I get the same results? It is the
> same letters/chars after all.
> 
> set the useUnicode to true
> put chartonum(char 1 to 2 in word 2 in fld "q2") - returns 15360 !!!!!
> 
> set the useUnicode to true
> put chartonum(char 1 to 2 in word 2 in fld "q1") - returns 14080 !!!
> 
> These are the same characters! I repeated it with itemDel = space, and
> char 1 to 2 item 1/2 and got the same result. Does unicode somehow
> handle words/items differently? I am very confused.
> 
> Cheers,
> 
> Lars
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list