Quoted-Printable & Base64 Unicode Text in LC7
Peter W A Wood
peterwawood at gmail.com
Sun Jun 1 10:05:46 EDT 2014
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
More information about the use-livecode
mailing list