Cameron McCormack
2008-06-09 03:29:01 UTC
It seems to be possible to send a Document using XHR where the encoding
specified by the Content-Type charset parameter differs from the actual
encoding used to encode the serialisation. For example by:
var r = new XMLHttpRequest();
r.open("POST", "somewhere");
r.setRequestHeader("Content-Type", "application/xml;charset=US-ASCII");
var doc = document.implementation.createDocument(null, "á", null);
r.send(doc);
Since passing a String to send() will cause the charset to be fixed up
to match the actual encoding used (UTF-8, in that case), shouldn’t
passing a Document to send() do the same?
specified by the Content-Type charset parameter differs from the actual
encoding used to encode the serialisation. For example by:
var r = new XMLHttpRequest();
r.open("POST", "somewhere");
r.setRequestHeader("Content-Type", "application/xml;charset=US-ASCII");
var doc = document.implementation.createDocument(null, "á", null);
r.send(doc);
Since passing a String to send() will cause the charset to be fixed up
to match the actual encoding used (UTF-8, in that case), shouldn’t
passing a Document to send() do the same?
--
Cameron McCormack ≝ http://mcc.id.au/
Cameron McCormack ≝ http://mcc.id.au/