Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by mike hills on Jan 30, 2009 05:14
open dhtmlx forum
grids and utf-8 data.

>> The presence of these characters seems to cause a problem.
>> The XML returned is specified as being utf-8 encoded
By default XML uses UTF-8 encoding, in your case the data most probably written in some specific encoding ( most probably iso-8859-1 )
In such case you need change header of XML to the
<?xml version="1.0" encoding="iso-8859-1" ?>

The grid itself will work in same encoding as encoding of HTML page, so it can work with any encoding supported by browser.

What if the data in the grid contains both iso-8859-1 and utf-8 characters (i.e. Asian character set).  Shouldn't utf-8 encoding handle iso-8859-1 characters?
Answer posted by Support on Feb 02, 2009 03:24
>>Shouldn't utf-8 encoding handle iso-8859-1 characters?
utf-8 may show the same glyphs as iso-8859-1 , but it uses the different codes for such characters.
So while it possible show in utf-8 the same data, just coping the text from iso-8859-1 encoded document and pasting in utf-8 encoded document will produce error.
In iso-8859-1 umlauts encoded as high ASCII chars, in utf-8 high ASCII values reserved for multi-byte combinations, so high ASCII characters of iso-8859-1 will result in XML parsing error. 

If you need to inject some iso-8859-1 data into utf based document, you need some kind of utf8_encode functionality.