Problem with Latin 1 (I think)

Bob Sneidar bobs at twft.com
Mon Feb 6 13:15:26 EST 2012


This bit in the Dictionary might be somewhat misleading then: "Use the uniEncode function to convert single-byte characters to double-byte characters." Also, this bit of code:

put "1234" into theTest
put length(theTest) into theSingleCount
put uniEncode(theTest, "English") into theUniTest
put length(theUniTest) into theMultiCount
put theSingleCount & cr & theMultiCount

produces this result:
4
8

Unless I am misunderstanding you, uniEncode would appear to take single byte characters and convert them to double byte. I am thinking the reason to convert it all to multibyte and back again is because mixed byte text would confuse uniDecode, as it assumes everything in the second argument is multibyte. 

Bob


On Feb 6, 2012, at 9:47 AM, J. Landman Gay wrote:

> On 2/6/12 11:32 AM, Bob Sneidar wrote:
> 
>> The multibyte characters are like Chinese and Euro currency, the
>> single byte characters are like US dollars. Uniencode is the bank
>> next door and Unidecode is the first bank. Uniencode converts ALL the
>> characters to multibyte, and Unidecode converts it all back to the
>> single byte equivalents of the language you specify.
> 
> That's a pretty good analogy. The missing bit of info, I think, is that LiveCode unicode isn't standard, it's a combination of single and double-byte characters. So we need to convert the text twice, once to get it into LiveCode's non-standard form and then again to convert it to display in a field.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
> 
> _______________________________________________
> 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