W3C home > Mailing lists > Public > public-webapi@w3.org > June 2008

[XHR] Sending a Document with a mismatched encoding

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 9 Jun 2008 13:29:01 +1000
To: public-webapi@w3.org
Message-ID: <20080609032901.GF16479@arc.mcc.id.au>

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);

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:27 UTC