[XHR] Sending a Document with a mismatched encoding

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?

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Monday, 9 June 2008 03:29:48 UTC