revXMLText and accented characters on Windows

Trevor DeVore trevor at mangomultimedia.com
Sat Oct 4 13:59:03 CDT 2003


I am creating an XML file from Revolution and saving it as UTF8.  I 
have it working on OS X but am experiencing problems with Windows (win 
2000).  When an accented character is entered such as é (e with an 
accent egout) then it seems the character is encoded when using 
revXMLText on Windows.

The code below works fine on Mac OS X with an input string of "é is 
accented".  It creates the file and when I open it in BBEdit on Mac or 
IE Explorer on Win then the accented characters display correctly.  On 
Windows the same code (with path name changed and text entered into the 
field on win platform) creates an output file that with the string 
represented as "頩s accented".

Any ideas on how to get around this?

-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com


Here is the code:

on mouseUp
   put revCreateXMLTree("<test>" & text of field 1 & "</test>", false, 
true, false) into tTreeID
   put "/Users/trevordevore/Desktop/test1.xml" into tPath
   put revXMLRootNode(tTreeID) into tRootNodeID

   get revXMLText(tTreeID)
   open file tPath for binary write
   write (uniDecode (GetBOM() & uniEncode (revXMLText(tTreeID, 
tRootNodeID), "UTF16"), "UTF8")) & \
	to file tPath
   close file tPath
end mouseUp

function GetBOM
   set the useUnicode to true
   return numToChar(abs(baseConvert("FEFF",16,10))) -- Thanks Dar :)
end GetBOM




More information about the use-livecode mailing list