CSV to XML: How do I preserve UTF-8??

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mryno
Posts: 1
Joined: Fri Mar 04, 2011 12:05 am

CSV to XML: How do I preserve UTF-8??

Post by mryno » Fri Mar 04, 2011 12:11 am

I am working on a program that takes a csv file in and submits XML to a webservice. I have it working except that the XML I send out is not in UTF-8. Here is an example of what is happening:

Español appears in the XML as Espa񯬠

For some reason, it isn't preserving the UTF-8 encoding. I suspect it may be something with revAddXMLNode, revXMLText, etc. that I am not doing correctly. Any ideas??

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

Re: CSV to XML: How do I preserve UTF-8??

Post by Mark » Fri Mar 18, 2011 4:43 pm

Mryno,

The easy way is to read the CSV file, convert it from UTF8 to ANSI (English), then make an XML tree out of it and convert your XML tree from ANSI to UTF8.

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