Cyrillic input
Mark Schonewille
m.schonewille at economy-x-talk.com
Tue May 31 04:41:58 EDT 2011
Malte,
First:
put uniEncode(someDataFromFile,"UTF8") into myData
set the unicodeText of fld x to myData
Then a few possibilities:
set the textfont of fld x to "SomeFont,Unicode"
(may have some unexpected side-effects) or
set the textFont of char 1 to -1 of fld x to "SomeFont,Unicode"
(may cause the input method back to English or other unwanted languages)
If a field is to be edited, you might want to try
set the textFont of fld x to "SomeFont,Cyrillic"
because this causes the input method to switch to Cyrillic (if no bugs are encountered).
I have just noticed that using non-english methods with password fields indeed causes trouble. Perhaps you need to catch the keyDown message or the rawKeyDown message and do everything manually. It might be useful to have a look at my password field (on my homepage) even though it doesn't work with Cyrillic (yet).
--
Best regards,
Mark Schonewille
Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553
New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce
On 31 mei 2011, at 10:22, Malte Brill wrote:
> Hi all,
>
> for the first time I need to deal with cyrillic input (and reading from text files) in liveCode. Now I am a bit stumped.
>
> When I switch my keyboard to russian, the text field does seem to automagically recognize that I am typing in cyrillic. The glyphs show up. So far so good. If I now try to feed the field from a text file (encoded in UTF-8) I fail miserably. The text does not show up. What do I need to do to make this work?
>
> Next problem. I have scriped some password fields. These work fine for normal ASCII. I just set the imagesource for each char and this is ok.
> However, as soon as I use cyrillic input, rawkeydown does not seem to fire anymore. If I then try to hide my glyphs that have been input, I end up with 2 imagesources per glyph (which is sensible, as each char is made up of 2 bytes.)
>
> Has anybody tackled situations similar to this? Any pointers much appreciated.
>
> Malte
More information about the use-livecode
mailing list