Problem with Latin 1 (I think)

Bob Sneidar bobs at twft.com
Mon Feb 6 12:32:40 EST 2012


Let's say you were at a bank trying to convert all your currency to US dollars (although why you would do that these days is beyond me). You have some Chinese currency and some Euro currency. The bank you are at refuses to convert Chinese currency at all, but will convert Euros. The bank next door will convert Chinese to Euros but nothing to US. The solution? Go next door and convert your Chinese currency to Euros, then come back and convert all your Euros to US dollars. 

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. 

It's kind of like that (I think). 

Bob


On Feb 6, 2012, at 8:21 AM, Geoff Canyon Rev wrote:

> Okay, so I'm at a loss. This worked, but...why?
> 
> I first have to *encode* it, then *decode* it? If it's already UTF8, why am
> I encoding it as UTF8? is it that some of it is encoded, and the encoding
> function is encoding the rest, but knows not to encode the characters that
> are already encoded? If that's the case, why isn't the decode function
> smart enough to only decode the characters that need it? Or am I completely
> misunderstanding?
> 
> thanks for the solution in any case.
> 
> gc
> 
> On Mon, Feb 6, 2012 at 3:51 AM, Malte Brill <revolution at derbrill.de> wrote:
> 
>> put unidecode(uniencode(pContents,"UTF8"),"english")
>> 
> _______________________________________________
> 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