Bug 12099

Summary: XMLHttpRequest shouldn't honor a charset specified via setRequestHeader
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: XMLAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
proposed patch darin: review+

Description Alexey Proskuryakov 2007-01-03 08:56:01 PST
Overriding Content-Type as 

req.setRequestHeader("Content-Type", "text/plain; charset='some-encoding'");
req.send(aString);

makes the sent string be encoded as "some-encoding" in WebKit, but not in MSIE or Firefox, where it's always sent as UTF-8. The XMLHttpRequest spec draft mandates IE/Firefox behavior, of course.

Additionally, looking at Content-Type further complicates the choice of encoding for documents, see bug 11695.
Comment 1 Alexey Proskuryakov 2007-01-08 02:50:19 PST
Created attachment 12298 [details]
proposed patch
Comment 2 Darin Adler 2007-01-08 10:12:10 PST
Comment on attachment 12298 [details]
proposed patch

r=me
Comment 3 Alexey Proskuryakov 2007-01-08 12:06:13 PST
Committed revision 18675.