When data is loaded from XML file|string, there are some special characters that can cause problem. For XML these characters are ”<”, ”>”, and ”&”. There are two ways to store them in XML:
> => &gt; < => &lt; & => &amp;
<cell> Specail characters < > &</cell> <= Incorrect <cell> Specail characters &lt; &gt; &amp;</cell> <= Correct <cell><![CDATA[ Specail characters < > &]]></cell> <= Correct
The component is encoding-agnostic. It will support any encoding that is supported by the browser. The user should just be sure to have correct XML header:
<?xml version="1.0" encoding="ISO-8859-1" ?>
The encoding attribute must specify correct encoding value (if such attribute is omitted, UTF-8 will be used by default).
By default, the grid treats all incoming data as HTML, so it will convert any HTML special character (including <, > and & characters). To resolve such issue, the grid supports pure text excell. In contrast with default ones, these excells will not allow any HTML content inside them, but will preserve any special characters and allow correct edition of such special chars.
The following pure text cell types are available:
<script> grid.setColTypes("rotxt") // type codes list (default delimiter is ",") ... grid.addRow(1,"<&>"); // will render the text correctly </script>
When the grid is serialized back to XML, special characters in cells can corrupt the result XML. To prevent such issue, the user can force the usage of CDATA while serialization (CDATA makes any content safe, so the resulting XML will be valid in any case).
Such mode can be enabled with setSerializationLevel() command.