iOS and xml: I don't understand unicode...
m.schonewille at economy-x-talk.com
Thu Dec 22 13:13:20 CST 2011
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.
Economy-x-Talk Consulting and Software Engineering
Become our partner in sales http://qery.us/1bq 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.
> Chris Sheffield
> Read Naturally, Inc.
More information about the use-livecode