Unicode revisited, this time with htmlText

Toma Tasovac ttasovac at Princeton.EDU
Wed Nov 19 12:10:26 EST 2003

Thanks, Klaus!

but I am still not quite clear whether the fact that I cannot set 
Unicode htmlText from the message box is a bug or a consequence of my 
not getting the syntax right.  I think there should be a way of setting 
the basic html styling of Unicode text without having to import it from 
a text file and move it between the two fields.

More specifically, I am playing now with the display possibilities of 
Unicode strings that I'm getting from a mySQL database.  Since I'm 
getting different strings from two different tables and several 
different columns, but displaying them all in one text field, it would 
make the most sense if I could script the html tags such as <b>, <i>, 
<font color> etc...  to get a fabulously styled and deligtfully elegant 
display of my information... :)

On Nov 19, 2003, at 5:07 PM, Klaus Major wrote:

> HTMLtext works for me here, but only via another field.
> I saved your example in TextEdit as plain-text (coding UTF16, when set 
> to UTF8, all the text turns to "chinese" in RR?),
> and imported it into a field
> ...
> set the unicodetext of fld 1 to url("binfile:toma.txt")
> ...
> And could then set the htmltext of any field to any chunk of that 
> field like
>  set the htmltext of fld 2 to the htmltext of line 1 of fld 1
> On Nov 19, 2003, at 12:24 PM, Toma Tasovac wrote:
>> 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?

More information about the Use-livecode mailing list