a little unicode help

Chris Sheffield cmsheffield at me.com
Tue Oct 30 11:51:11 EDT 2012


Thanks for the quick reply, Mark.

I've tried treating all text as unicode, but the characters from the English keyboard still don't work right. But maybe my problem is in the conversion. So I'm retrieving the unicodeText property of the native text field. Then I'm using the unicodeText property of a LiveCode field to display the entered text. And in that field, I either have garbled text, or it just gets chopped off, only displaying maybe the first character. There is something goofy, but I think it's probably just my lack of knowledge of how this should work.

Chris


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

> Hi Chris,
> 
> Just consider all text as unicode. 
> 
> I'm not sure that it is possible to display different types of unicode (Japanese, Hebrew, English, Russian, Thai) next to each other in one field. This used to be impossible, but I hope this was changed in the latest version of LC.
> 
> --
> 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 16:36, Chris Sheffield wrote:
> 
>> I know several of you out there are unicode "experts". I'm in need of a little help with something.
>> 
>> Working on an iPad app. At one point I'm using a native input text field to get the user's name. Until yesterday I was simply retrieving the text property of the field and all was working well. But we have a tester who is Russian speaking, and yesterday I received a report from him that when using his Russian keyboard on the iPad, the app was crashing at the point that it retrieves the text from the field. This is probably some kind of bug, as the app should not crash like this, but I'll deal with that later since I think I've found the workaround. I discovered that I could use the unicodeText property of the field instead and avoid the crash, and it would retrieve the Russian characters without a problem. However, when I want back to test using the English keyboard again, I end up with garbled text, of course. I've tried using various combinations of uniDecode and uniEncode, but nothing seems to work correctly. I either end up with garbled English characters, or garbled Russian
> (or any other language that uses unicode characters for that matter).
>> 
>> So what it boils down to is this. Is there any way to detect if a string of characters contains unicode characters? If I could detect unicode vs. non-unicode, I think I could make this work like I want. Or maybe there's a better way? I just need something that will not crash, and that will correctly retrieve the text that's entered into the field. This user name gets saved to a sqlite database, btw. I'm not sure if anything needs to be taken into consideration for that or not.
>> 
>> Any takers?
>> 
>> Thanks,
>> 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