Skip to main content

Bug Tracker

Side navigation

#5428 closed bug (wontfix)

Opened October 30, 2009 07:59PM UTC

Closed November 19, 2010 06:20AM UTC

Last modified March 10, 2012 08:58AM UTC

Change in IE's default ajax headers to prevent encoding problems

Reported by: victorwss Owned by:
Priority: major Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: ie content-type Cc:
Blocked by: Blocking:
Description

There are a problem that arise from a difference in the HTTP headers sent to the server.

In firefox, an ajax request generates this header:

content-type: application/x-www-form-urlencoded; charset=UTF-8

In IE we have this:

content-type: application/x-www-form-urlencoded

There are already some reports about encoding problems when using ajax, specially in Internet Explorer. Tickets #3611 (and the duplicates #4315 and #4408) are related to this, however they are about the serialization of the data, not about the headers. Ticket #4855 may be related too, but is a different issue.

So, I think that we should have, at least by default, to add the missing "; charset=UTF-8" in the content-type header of the IE's XMLHttpRequest. This would reduce encoding problems encountered by developers and users giving the possibility of more and better solutions and workarounds for the remanescent ones. This plays better with jQuery compatibility between different browsers too.

Attachments (0)
Change History (3)

Changed October 31, 2009 12:30AM UTC by dmethvin comment:1

component: unfilledajax
description: There are a problem that arise from a difference in the HTTP headers sent to the server. \ \ In firefox, an ajax request generates this header: \ \ content-type: application/x-www-form-urlencoded; charset=UTF-8 \ \ In IE we have this: \ \ content-type: application/x-www-form-urlencoded \ \ There are already some reports about encoding problems when using ajax, specially in Internet Explorer. Tickets 3611 (and the duplicates 4315 and 4408) are related to this, however they are about the serialization of the data, not about the headers. Ticket 4855 may be related too, but is a different issue. \ \ So, I think that we should have, at least by default, to add the missing "; charset=UTF-8" in the content-type header of the IE's XMLHttpRequest. This would reduce encoding problems encountered by developers and users giving the possibility of more and better solutions and workarounds for the remanescent ones. This plays better with jQuery compatibility between different browsers too.There are a problem that arise from a difference in the HTTP headers sent to the server. \ \ In firefox, an ajax request generates this header: \ \ content-type: application/x-www-form-urlencoded; charset=UTF-8 \ \ In IE we have this: \ \ content-type: application/x-www-form-urlencoded \ \ There are already some reports about encoding problems when using ajax, specially in Internet Explorer. Tickets #3611 (and the duplicates #4315 and #4408) are related to this, however they are about the serialization of the data, not about the headers. Ticket #4855 may be related too, but is a different issue. \ \ So, I think that we should have, at least by default, to add the missing "; charset=UTF-8" in the content-type header of the IE's XMLHttpRequest. This would reduce encoding problems encountered by developers and users giving the possibility of more and better solutions and workarounds for the remanescent ones. This plays better with jQuery compatibility between different browsers too.
keywords: → ie content-type

Changed November 19, 2010 06:20AM UTC by snover comment:2

_comment0: Firefox is the only browser that appends a charset to the header. Your application should assume content without an explicit character set is being transmitted as UTF-8.1290147660084927
resolution: → wontfix
status: newclosed

Firefox is the only browser that appends a charset to the header. Your application should assume content without an explicit character set is being transmitted as UTF-8. Alternatively, use the contentType option of the ajax settings object to force the charset yourself.

Changed November 21, 2010 09:10PM UTC by hminaay comment:3

Chrome also appends it. This should be fixed to include the chartset.