Re: Russian (UTF-8) in LC 4.6

2011-05-08 Thread Curt Ford
Hello Slava,

One of my projects worked pretty well with Russian, but it involved mostly 
typing in Russian, saving to a file as HTMLText, and later reading in that 
HTMLText for display in fields. The one place that involved manipulating the 
strings directly ('exploding' the words to display individual letters 
separately) was kind of a pain, especially in expressions that included a space 
or any punctuation. You can get a sense of what I was able to do at 

http://www.sonasoftware.com/vocab/

I hope the real Unicode support comes before too long - this issue is one of 
the main reasons I've started working in ObjectiveC for some projects.

Just in case you haven't seen it, Devin Asay has a nice summary at 

http://www.runrev.com/developers/lessons-and-tutorials/tutorials/unicode-in-revolution/

best

Curt






___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Russian (UTF-8) in LC 4.6

2011-05-08 Thread Slava Paperno (Bridge)
Hi Curt! It was good to hear from a colleague.

I'd known about your Sona cards, but I forgot (or never knew) that they were
done in LiveCode. But I went through the Web site and was quite impressed.
The site is well done, too. (I used it in Chrome, and everything looked
great.) Good job!

Thanks also for the reference to Devin Asay's article. It told me almost
everything I needed to know about Russian in LC 4.6. I do understand (and
sympathize with) the LC developers as they struggle with these issues and
introduce workarounds and fixes. It'll be quite a burden for them to keep
the system backward compatible as they move towards full and natural support
for Unicode.

As you probably know, I use the custom fonts we designed to show accented
vowels in all Russian texts in my software publications. Conversion from
accented text to unaccented text, from accented lower case to accented upper
case vowels, translating keystrokes to offer the Student keyboard layout,
normalizing strings for dictionary lookups and sorting, etc. is part of just
about every step in programming and using my publications. Variables,
arrays, property lists, and various loops are used everywhere. So when I saw
Devin's two-long-lines script that's needed just to assign a Russian word to
a field, and read about accessing a Russian character as a two-character
sequence, and also shipping them around as HTML entities, I had to scratch
my head.

I'll stay around this list and learn what I can about LiveCode this summer.

Gratefully,

Slava

 -Original Message-
 From: use-livecode-boun...@lists.runrev.com [mailto:use-livecode-
 boun...@lists.runrev.com] On Behalf Of Curt Ford
 Sent: Sunday, May 08, 2011 6:56 AM
 To: use-livecode@lists.runrev.com
 Subject: Re: Russian (UTF-8) in LC 4.6
 
 Hello Slava,
 
 One of my projects worked pretty well with Russian, but it involved
 mostly typing in Russian, saving to a file as HTMLText, and later
 reading in that HTMLText for display in fields. The one place that
 involved manipulating the strings directly ('exploding' the words to
 display individual letters separately) was kind of a pain, especially
 in expressions that included a space or any punctuation. You can get a
 sense of what I was able to do at
 
 http://www.sonasoftware.com/vocab/
 
 I hope the real Unicode support comes before too long - this issue is
 one of the main reasons I've started working in ObjectiveC for some
 projects.
 
 Just in case you haven't seen it, Devin Asay has a nice summary at
 
 http://www.runrev.com/developers/lessons-and-
 tutorials/tutorials/unicode-in-revolution/
 
 best
 
 Curt


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Russian (UTF-8) in LC 4.6

2011-05-07 Thread Slava Paperno (Bridge)
Is anyone using LC 4.6 for really foreign stacks, like Slavic languages or
Greek, in UTF-8?

In my tests of 4.6.1, the Contents box of fields and labels accepts Russian
fine, and it is displayed correctly, but Russian in a button caption or
tooltip turns into garbage (actually, it looks like it tries to display each
byte of the two-byte characters, poor thing). Trying to type Russian in the
code window totally bombs for me (the effect is indescribable).

I'm new to LC, so I may be missing something crucial here. The phrase in the
User Guide about writing your own functions to process strings sounds
ominous, and yet they recommend the use of UTF-8, but again speak darkly of
implementing an external if you wish to use string handling functions
(section 6.4.6 on UTF-8).

Can one even assign a Cyrillic string to a variable in the code window?

I must be doing something wrong--or should I wait for another version of LC?

Any tips will be appreciated,

Slava


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Russian (UTF-8) in LC 4.6

2011-05-07 Thread Mark Schonewille
Hi Slava,

You can set the label but not the name of button to a unicode string. In 
LiveCode, you always use UTF16. If you have a UTF8 string, you need to convert 
it to UTF16 before you can use it in LiveCode. To convert a UTF8 string to 
UTF16, use the following syntax:

put uniEncode(myUTF8StringVar,UTF8) into myUTF16StringVar

and to convert from UTF16 to UTF8 use

put uniDecode(myUTF16StringVar,UTF8) into myUTF8StringVar

I think that it should be possible to assign a cyrillic string to a variable in 
a script, but it won't be easy. It is easier to keep your data in fields or 
custom properties.

There might be a LiveCode version that handles unicode text better in the 
future, but if you have to deliver a project anytime soon, I wouldn't wait for 
that new version.

Btw you can set the unicodeTitle of a stack.

--
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 8 mei 2011, at 02:24, Slava Paperno (Bridge) wrote:

 Is anyone using LC 4.6 for really foreign stacks, like Slavic languages or
 Greek, in UTF-8?
 
 In my tests of 4.6.1, the Contents box of fields and labels accepts Russian
 fine, and it is displayed correctly, but Russian in a button caption or
 tooltip turns into garbage (actually, it looks like it tries to display each
 byte of the two-byte characters, poor thing). Trying to type Russian in the
 code window totally bombs for me (the effect is indescribable).
 
 I'm new to LC, so I may be missing something crucial here. The phrase in the
 User Guide about writing your own functions to process strings sounds
 ominous, and yet they recommend the use of UTF-8, but again speak darkly of
 implementing an external if you wish to use string handling functions
 (section 6.4.6 on UTF-8).
 
 Can one even assign a Cyrillic string to a variable in the code window?
 
 I must be doing something wrong--or should I wait for another version of LC?
 
 Any tips will be appreciated,
 
 Slava
 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Russian (UTF-8) in LC 4.6

2011-05-07 Thread Slava Paperno (Bridge)
Thanks, Mark! It sounds like I should probably wait for full Unicode
support. I'm trying to decide if I can move from Adobe Director to LC. In my
Director applications, I type Cyrillic in the code and message windows all
the time, and the ease of manipulating strings during development is very
important. Always having to read my strings from files or fields would be a
real pain...

Gratefully,

Slava
 
 -Original Message-
 From: use-livecode-boun...@lists.runrev.com [mailto:use-livecode-
 boun...@lists.runrev.com] On Behalf Of Mark Schonewille
 Sent: Saturday, May 07, 2011 8:41 PM
 To: How to use LiveCode
 Subject: Re: Russian (UTF-8) in LC 4.6
 
 Hi Slava,
 
 You can set the label but not the name of button to a unicode string.
 In LiveCode, you always use UTF16. If you have a UTF8 string, you need
 to convert it to UTF16 before you can use it in LiveCode. To convert a
 UTF8 string to UTF16, use the following syntax:
 
 put uniEncode(myUTF8StringVar,UTF8) into myUTF16StringVar
 
 and to convert from UTF16 to UTF8 use
 
 put uniDecode(myUTF16StringVar,UTF8) into myUTF8StringVar
 
 I think that it should be possible to assign a cyrillic string to a
 variable in a script, but it won't be easy. It is easier to keep your
 data in fields or custom properties.
 
 There might be a LiveCode version that handles unicode text better in
 the future, but if you have to deliver a project anytime soon, I
 wouldn't wait for that new version.
 
 Btw you can set the unicodeTitle of a stack.
 
 --
 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 8 mei 2011, at 02:24, Slava Paperno (Bridge) wrote:
 
  Is anyone using LC 4.6 for really foreign stacks, like Slavic
 languages or
  Greek, in UTF-8?
 
  In my tests of 4.6.1, the Contents box of fields and labels accepts
 Russian
  fine, and it is displayed correctly, but Russian in a button caption
 or
  tooltip turns into garbage (actually, it looks like it tries to
 display each
  byte of the two-byte characters, poor thing). Trying to type Russian
 in the
  code window totally bombs for me (the effect is indescribable).
 
  I'm new to LC, so I may be missing something crucial here. The phrase
 in the
  User Guide about writing your own functions to process strings sounds
  ominous, and yet they recommend the use of UTF-8, but again speak
 darkly of
  implementing an external if you wish to use string handling
 functions
  (section 6.4.6 on UTF-8).
 
  Can one even assign a Cyrillic string to a variable in the code
 window?
 
  I must be doing something wrong--or should I wait for another version
 of LC?
 
  Any tips will be appreciated,
 
  Slava



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode