function: text_Utf8ToHtml

David Bovill david at
Fri Aug 29 14:54:26 EDT 2008

Guess this will have to do. Seems to work:

function text_Utf8ToHtml someUtf8, someField
    lock screen
    put the htmltext of someField into oHtml
    put uniencode(someUtf8, "UTF8") into someU16
    set the unicodetext of someField to someU16
    put the htmltext of someField into someHtml
    set the htmltext of someField to oHtml
    unlock screen
    delete char 1 to 3 of someHtml
    delete char -4 to -1 of someHtml
    return someHtml
end text_Utf8ToHtml

More information about the use-livecode mailing list