charset encoding decoding with textEncode / textDecode

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
godot
Posts: 14
Joined: Tue Aug 04, 2015 8:38 pm

charset encoding decoding with textEncode / textDecode

Post by godot » Fri Jan 29, 2016 9:27 pm

Hi;

On a mac 10.11.2, with livecode 7.1.1, I have problems with certain character encodings...
First of all, I can't use textEncode or textDecode for the CP-1252 charset. If I try :

Code: Select all

put textencode("test","CP1252")
I get :
"Message execution error:
Error description: textEncode: could not encode text"
Can somebody confirm that this option is not available ? Does someone know why (it's not what the dictionary says) ? Is it only working on windows maybe ?

Also, there is something I don't understand :
How come the function textEncode() & textDecode() don't take "ISO-8859-1" as encoding option except on Linux OS (see the dictionary entry of both functions) even though if you combine the function IsoToMac() and texteDecode, I can produce the exact same result.

Code: Select all

 put textDecode(isoToMac(texte),"MacRoman") 
Shouldn't Livecode implement this option on mac as it can do it ?

Thanks for any help,
Godot

FredBeck
Posts: 77
Joined: Fri Nov 01, 2013 3:07 pm
Location: Paris
Contact:

Re: charset encoding decoding with textEncode / textDecode

Post by FredBeck » Sat Jan 30, 2016 12:36 pm

Native encodings are only available on the respective platforms, as written in the release notes here (page 15)
http://downloads.livecode.com/livecode/ ... -7_0_0.pdf
Its true that the dictionary is slightly incomplete here...
Fred.

godot
Posts: 14
Joined: Tue Aug 04, 2015 8:38 pm

Re: charset encoding decoding with textEncode / textDecode

Post by godot » Sat Jan 30, 2016 8:56 pm

Thanks for the answer Fred ! It explains both why I couldn't work with windows-1252 & what is the policy of Livecode with TextEncode/TextDecode : they only allow traslation between any unicode (utf-8, 16...) and "native" charset encoding.
How could I know if it is in the plan of Livecode to improve the options available ? I mean, it is supposed to be cross-plateform, isn't it ? :lol:

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”