Quoted-Printable & Base64 Unicode Text in LC7

Dar Scott dsc at swcp.com
Sun Jun 1 18:00:26 CEST 2014


base64Encode() 	binary —>  ASCII
base64Decode()	ASCII —> binary

textEncode()		Chars —> binary
textDecode()		binary —> Chars

ASCII text can be used as Unicode characters or binary.  (Well, native, but I ignore native.)

I think there are functions for quoted printable, but I forgot what they are.

????Encode()		Chars —> ASCII
????Decode()		ASCII —> Chars

But, I”m not sure, since I can’t remember the name.  


Dar Scott



On Jun 1, 2014, at 8:05 AM, Peter W A Wood <peterwawood at gmail.com> wrote:

> Igor
> 
> On 1 Jun 2014, at 19:40, Igor de Oliveira Couto wrote:
> 
>> 1) How to decode from “quoted-printable” to normal text?  Is there a ready-made function somewhere?
> 
> From the dictionary:
> 
> 	textDecode("A","UTF8")
> 
>> 2) LiveCode’s base64decode() function seems to assume that we are always dealing with ascii text - this is using version 7.0-dp6. If I get the base64decode of "UXVhbGljb3JwIFNhw7pkZQ==“ (the sender of the first example above), I get "Qualicorp Sa√∫de”, when I should be getting “Qualicorp Saúde”. 
>> 
>> I guess that somehow I should be telling LiveCode that these characters are UTF-8. What function(s) do we use for converting between encodings in LiveCode 7? The functions that we would have used in previous versions (uniEncode, uniDecode) are now deprecated, so in a situation like this, what should we use? And, shouldn’t LC7 assume by default that everything is unicode?
> 
> As I understand, the LiveCode engine assumes text is encoded in the "native" encoding for the platform. I use quotes because LiveCode still seems to treat MacRoman as the native encoding for OS X.
> 
> It probably would be better is the LiveCode server engines assumed text to be UTF-8 encoding.
> 
> Regards
> 
> Peter
> 
> 
> 
> _______________________________________________
> 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