Hi,
I see a lot of examples for converting UTF-8 to UTF-16 but not the other way around. I am editing the XML in a MS Word document, which expects UTF-8. I have tried changing the encoding in the XML to use UTF-16 but it doesn't work (MS just seems to ignore that direction).
I have a word "Équipe" that I am putting into the Word XML. I have also created a basic document to see what Word does in encoding the word. The letter "É" is encoded (hex) as C3 89, whereas the UTF-16 value is (hex) C9. I checked other characters and it seems the accented characters are represented in Word as C3 and hex 40 less than the UTF-16 value.
Is there any code that converts the UTF-16 from Livecode into the UTF-8 I need for MS Word?
Thanks for any assistance
Cheers
Bergsy
Convert UTF-16 to UTF-8
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Convert UTF-16 to UTF-8
If you're using LC 7.x the "textEncode" command is the easiest way. From the dictionary:
put textEncode(field "output","UTF-8") into tOutput
put textEncode(field "output","UTF-8") into tOutput
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Convert UTF-16 to UTF-8
Hi Jacque,
That did the trick - thanks
Bergsy
That did the trick - thanks

Bergsy