Unicode revisited, this time with htmlText

Toma Tasovac ttasovac at Princeton.EDU
Wed Nov 19 06:24:15 EST 2003


As usual, I have a question about Unicode :)  I have a text field whose 
textFont is set to "Lucida Grande", Unicode.  I am using the message 
box to get some html text in it -- and I can't get it to work properly. 
  The Transcript Dictionary entry for htmlText says that the lang 
attribute and ability to encode Unicode characters was added in 2.0 but 
does not go into great detail explain how that is to be done.

set the htmlText of field "Field 1" to "<b>hello</b>"    -- produces 
CJK gibberish
set the htmlText of field "Field 1" to uniencode("<b>hello</b>", 
"utf8") -- produces different CJK gibberish

Trying the same with a Cyrillic string:

set the htmlText of field "Field 1" to "<b>добар дан</b>" -- correctly 
displays the first word, second word is gibberish
set the htmlText of field "Field 1" to uniencode("<b>добар дан</b>", 
"utf8") -- displays complete gibberish

SO: what would be the correct syntax for displaying Unicode in 
htmlText?  and how do I make sure that both English and non-English 
strings are displayed properly?

All best,
Toma





More information about the use-livecode mailing list