posted by admin
on Sun, 11/30/2014 - 10:50
I was using jqgrid to display some "filtered" data on grid, but some filters won't display any data. My immediate suspect was special characters that may interfere with XML markup.
After looking at Extensible Markup Language (XML) 1.0 (Second Edition) specification, disallowed characters are defined in IETF RFC 2396 except for (#), (%) and square bracket characters are re-allowed. Per W3 recommendation, there are three ways as recommended.
- Each disallowed character is converted to UTF-8
- Any octets corresponding to a disallowed character are escaped with the URI escaping mechanism (that is, converted to %HH, where HH is the hexadecimal notation of the byte value).
- Better yet, enclose your data in <![CDATA[ your text here ]]>
Comments
We've noticed that IE11 does
We've noticed that IE11 does not observe <![CDATA[ your text here ]]>.
To escape XML, use StringEscapeUtils.
Add new comment