Re: [XHR2] overrideMimeType

Anne van Kesteren wrote:
> 
> I've been looking at overrideMimeType implementations in Gecko and 
> WebKit and it seems like they differ a bit. In Gecko it has to be 
> invoked before send(), but in WebKit it would work if you invoke it just 
> before getting responseXML or responseText. Neither implementation seems 
> to do any input checks.
> 
> If you have any opinion on how it should be specified I suppose now 
> would be the time to air your thoughts.

Of course I prefer the mozilla way :)

It does seem fairly complicated to allow it to be set after the download 
is finished though. You do have the stream stored in .reponseBody, but 
at that point all encoding information has been lost. For HTML parsing 
(which I hope the spec will support in the future) there are a pile of 
rules used to guess the encoding, all of which would be useful to use, 
but can't be used if all you have access to is the unencoded responseBody.

/ Jonas

Received on Friday, 27 July 2007 19:10:14 UTC