Page 1 of 1

Please help with understanding of encoding needs

Posted: Fri Nov 22, 2013 10:37 pm
by makeshyft
Hello everyone,

I have been doing a lot of research on this encoding business, having realized that I must build International Text Support into my app, I don't have a choice to put it off to the next version.

Here is what I have understood about encoding and Livecode and SQL together, please please please correct me if I am wrong on any of these points.

1 The default encoding for the livecode engine is ASCII (?????? I don't get why)
2 Fields and controls are all UTF-8, because UTF-8 preserves ASCII
3 UTF-8 is a variable byte 1-4 and covers MANY or MOST characters. (???)
4 UTF-16 is needed to ensure that all characters are accepted in all languages.
5 SQL 3 accepts both UTF-8 and UTF-16 content (does it have to be a blob?), but some of its functions only work with 8 ?
Can I get away with UTF 8 only and feel confident that all people who want to use it will be able to use it? I gather no....

Is my understanding correct on this? I am in the process of building my UI String Database and must bulid my string in / out functions

I have also heard that the next version will have this built in, but I can't wait for this, for a may not switch to it right away...sigh

Thanks to all those who reply.

Re: Please help with understanding of encoding needs

Posted: Sat Nov 23, 2013 6:02 pm
by makeshyft

Re: Please help with understanding of encoding needs

Posted: Sat Nov 23, 2013 8:30 pm
by jacque
LiveCode's native encoding is UTF-16. But the easiest way to work with international text is to use the built-in functions. Search for "unicode" in the dictionary to see what's available.

Here's a function to change UTF-8 to LiveCode encoding:

Code: Select all

function utf8decode pString -- convert utf8 to LC native
  return unidecode(uniencode(pString,"UTF8"))
end utf8decode

Re: Please help with understanding of encoding needs

Posted: Mon Nov 25, 2013 4:32 am
by makeshyft
Thanks for your help. Userful snip. :D