Re: [XHR] i18n comment 7: Encoding of DOMString

Anne van Kesteren wrote:
> http://dev.w3.org/2006/webapi/XMLHttpRequest/#send

A few comments about Gecko behavior:

1)  Gecko always sends a DOMString 'data' as UTF-8.  The Content-Type header 
being sent is changed as needed if it does not already contain charset=UTF-8 (up 
to case, etc).

2)  When 'data' is a Document, it's encoded using the inputEncoding.  This may 
not match the xmlEncoding if the document was served over HTTP and there was a 
Content-Type header that specified a different encoding from the XML 
declaration.  The XML declaration, if any, in the serialization specifies the 
actual encoding used when serializing.  The XMLHttpRequest Content-Type header 
is also adjusted to specify the same encoding.

The one issue here is that we should probably make sure there is an XML 
declaration whenever the encoding is not UTF-8 or UTF-16....

I'm not sure I feel that strongly about inputEncoding vs xmlEncoding (though I 
do think serializing using the inputEncoding makes the most sense), but I do 
think that the adjustment of the various metadata so that it matches reality is 
important.

-Boris

Received on Thursday, 6 December 2007 17:21:45 UTC