IE's responseXML.getElementsByTagName() unable to handle non English character ?
- by trix
I have a javascript that does this (http is your XMLHttpRequest object)
var r = http.responseXML.getElementsByTagName('item');
The issue is variable r is always an empty list if the response contains non-English character (r.length is 0).
The response header is correctly set
Content-Type: text/xml;charset=ISO-8859-1
This is what the response from the webserver looks like
<?xml version='1.0' encoding='UTF-8'?>
<d>
<r>
<item value="jmob" label="John Möb"/>
</r>
</d>
It happens only in IE (both IE6 and IE8), works in Firefox and Chrome.
If items contain only English characters, it works fine.
Is there a workaround for this ?