a little unicode help

Chris Sheffield cmsheffield at me.com
Tue Oct 30 13:38:20 EDT 2012


Excellent! That seems to have done the trick. I had thought about trying that at one point, but hadn't quite gotten that far.

Thanks again for the help.

Chris

On Oct 30, 2012, at 10:44 AM, Mark Schonewille <m.schonewille at economy-x-talk.com> wrote:

> Hi Chris,
> 
> Are you 1) first retrieving the data from the native text field as unicode, then saving the data to SQLite, then reading it from SQLite and finally setting the text of the LiveCode field or 2) just retrieving the data from the native text field and immediately setting the unicodeText of the LiveCode field while also at some point saving the data to SQLite without affecting any of the variables containing the data?
> 
> If you are reading data from SQLite, then SQLite probably expects UTF8 while you're saving UTF16. Before you save data to SQLite, convert it:
> 
> put uniDecode(tUserName,"UTF8") into tUserName
> 
> and after you retreive it from SQLite encode it:
> 
> put uniEncode(tUserName,"UTF8") into tUserName
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> 
> Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour spaces. http://www.color-converter.com
> 
> 
> 
> On 30 okt 2012, at 17:32, Chris Sheffield wrote:
> 
>> Mark,
>> 
>> Here's a selection of my code. It really is quite simple.
>> 
>> I first retrieve the text from the native text input control:
>> 
>> put mobileControlGet(myInputID,"unicodeText") into tUserName
>> 
>> This user name then gets saved to a SQLite database. Then the user name is placed in a LiveCode field using:
>> 
>> set the unicodeText of field "name" to tUserName
>> 
>> This works if I use the Russian keyboard to enter text (I've just been using Russian, btw; I imagine the same problem would occur with any language). However, if I enter a name using the English keyboard, it doesn't work. The LiveCode is either empty or, in some cases, it will display the first character only.
>> 
>> I think the breakdown is in saving to the database. It seems like SQLite's unicode conversion may not be working correctly. But I tried a uniDecode() when saving to the db, and a uniEncode when retrieving, and that didn't seem to make any difference. Have you ever dealt with this before? Any other thoughts?
>> 
>> Thanks for you help,
>> Chris
>> 
> 
> 
> 
> _______________________________________________
> 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