Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Yves on Mar 17, 2008 15:00
open dhtmlx forum
DHTMLXTree XML encoding

I feed my DHTMLXTree with custom xml files that contain special characters (french letters). In order to be able to correctly work with the content of these files, I set the encoding to something like iso-8889-1 or windows-1252 on the server side (by default they're in UTF-8). When I load the non UTF-8 xmls via the browser (IE7) everything works just great and my xmls display as they should on the screen. But when I feed the same urls to the tree, it raises a javascript exception telling me the XML is incorrect.

Remarks. Without special characters the tree works with any encoding (utf, iso, windows...) . Also, with utf-8, even the browser refuses to display the xml from the given links (which is the reason I change the encoding on the server prior to send them to the client).


Any ideas?


Regards.
Answer posted by Support on Mar 18, 2008 03:13
>>When I load the non UTF-8 xmls via the browser (IE7)  ...

Please be sure that:
 
a) xml has encoding header <?xml version="1.0" encoding="iso-8859-1" ?>

b) data sent with correct content type (text/xml), in other case different parser will be used which works with UTF data only
Answer posted by Yves on Mar 25, 2008 03:12
Thank you very much, the second part of the answer got it working for me;

:-)