xml and utf-8 attribute

Ken Ray kray at sonsothunder.com
Sun Jan 15 14:22:09 EST 2006


On 1/14/06 3:33 PM, "praxMatrix Internet Services" <office at praxmatrix.com>
wrote:

> I'm having a lot of trouble getting the right characters to appear for an
> XML attribute. The file loads correctly and displays the English words with
> no problems but the translation attribute returns garbled characters. The
> XML is encoded as UTF-8. I've tried implementing the various suggestions
> I've found in the archives re uniDecode / htmlText etc but am having no
> luck. The languages I am trying to use are Spanish, French and Polish. Any
> pointers or links to tutorials would be very helpful. This is the typical
> format of the XML file:
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <player>
> <snd path="mp3/4.mp3" title="Spain"  desc="Member Countries of the European
> Union" trans="España" pic="img/es.jpg"/>
> </player>
> 
> This is the tanscript code that pushes the 'trans' attribute into the field:
> put revXMLAttribute(tDocID2,"/player/snd["&sndID&"]","trans") into field
> "trans"
> 
> And this is the typical output for non English characters:
> 
> España

Yeah, it appears that the revXML.dll can't handle character entities very
well (Peter Evensen identified this a couple of weeks back). Here's what I'd
posted in response:

-----
If your files aren't too large, you may wish to try my all-Transcript XML
library, which handles these without issue. If you're interested, contact me
off-list as I'm getting ready to release a major upgrade to the library
(2.0) which isn't available from my web site yet (only 1.1.7 is available
publicly).
-----

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list