weird problem with characters in XML

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Johan_VH
Posts: 67
Joined: Fri Mar 28, 2014 2:46 pm

weird problem with characters in XML

Post by Johan_VH » Wed Jul 09, 2014 4:53 pm

My data is read in from an xml-file. I use 3 languages (dutch, german and french) and hence have characters like ä and ç.

The XML has UTF-8 encoding in the header. If I save the xml as UTF-8, the characters get mangled by LiveCode, but open up fine in my XML editor.
If I use notepad and save the XML with ANSI encoding, the characters are ok in LiveCode, but my XML editor won't let me edit it.

So it's not so much of a huge problem, but I still think this is weird, and I am probably doing something wrong?

Johan

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: weird problem with characters in XML

Post by Mark » Thu Jul 17, 2014 2:58 pm

Hi Johan,

Did you solve this already? There shouldn't be any issues with this, but I'm not sure what you're doing exactly. Do you read the XML file with the external or directly? You may need to convert the data before displaying it, but there are also some encodings for use in XML, which you'll need to parse before displaying the data.

If you're retrieving text, you could try

Code: Select all

set the unicodeText of fld 1 to uniEncode(myXMLData,"UTF8")
It might be easier for both of us to discuss this in the Dutch forum.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply