Please help with understanding of encoding needs

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Please help with understanding of encoding needs

Post by makeshyft » Fri Nov 22, 2013 10:37 pm

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.
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Please help with understanding of encoding needs

Post by makeshyft » Sat Nov 23, 2013 6:02 pm

Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Please help with understanding of encoding needs

Post by jacque » Sat Nov 23, 2013 8:30 pm

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
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

makeshyft
Posts: 222
Joined: Mon Apr 15, 2013 4:41 am
Contact:

Re: Please help with understanding of encoding needs

Post by makeshyft » Mon Nov 25, 2013 4:32 am

Thanks for your help. Userful snip. :D
Founder & Developer @ MakeShyft R.D.A - https://www.makeshyft.com
Build Software with AppStarterStack for Livecode - https://www.AppStarterStack.com
Save Time with The Time Saver's Toolbox - https://www.TimeSaversToolbox.com

Post Reply