iOS and xml: I don't understand unicode...

Mark Schonewille m.schonewille at
Thu Dec 22 14:13:20 EST 2011

Hi Chris,

Read the file as binary, e.g. into variable myVar and then convert it with

put uniDecode(uniEncode(myVar,"UTF8")) into myVar

Now you can load the XML tree that's in myVar or parse it as standard ASCII text.

Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
KvK: 50277553

Become our partner in sales Start selling Color Converter today. 20% commission!

On 22 dec 2011, at 19:47, Chris Sheffield wrote:

> I need help. In more ways than one, but that's beside the point...
> I have a utf-8 encoded xml file that I'm reading data from for display in a text field. Everything seems to work just fine except for certain unicode characters, such as the em dash ("—"). When I read in the text and then set the htmlText property of the field, those characters are getting garbled. Am I just not understanding how unicode works? Do I need to do something special to make these characters appear correctly?
> What's strange is I can get that same character by using numToChar(209) in the LiveCode message box, but the character that is in my file does not seem to be the same one, even though on screen it looks identical. If I test it with something like:
> 	if numToChar(209) is in myText then
> it returns false. I'm stumped.
> Any help would be greatly appreciated.
> Thanks,
> Chris
> --
> Chris Sheffield
> Read Naturally, Inc.

More information about the Use-livecode mailing list