Skip to main content

Bug Tracker

Side navigation

#4624 closed bug (fixed)

Opened May 05, 2009 05:57AM UTC

Closed March 07, 2012 04:09PM UTC

Last modified March 13, 2012 04:25PM UTC

Charset in default ajaxSettings.contentType

Reported by: dimonnot Owned by:
Priority: minor Milestone: 1.7.2
Component: ajax Version: 1.3.2
Keywords: ajax, charset, needsreview Cc:
Blocked by: Blocking:
Description

ajaxSettings.contentType must be "application/x-www-form-urlencoded; charset=UTF-8"

Attachments (0)
Change History (9)

Changed May 06, 2009 02:18AM UTC by dmethvin comment:1

Do you have a test case where this change is required? Also, are you asking that jQuery be changed to use that as the default content type?

Changed June 11, 2010 03:03AM UTC by dmethvin comment:2

resolution: → worksforme
status: newclosed

The default charset is UTF-8 for all XHR posts, so I don't think any action is required.

Changed March 14, 2011 03:21PM UTC by castevinz@gmail.com comment:3

The default contentType of jquery doesn't mention the default charset.

In Firefox, the contentType is automatically updated with "''application/x-www-form-urlencoded; charset=UTF-8''", or in Google Chrome, the jquery default contentType is used, so "''application/x-www-form-urlencoded''" (look at the contentType in the request headers).

Although the default charset is UTF-8 for all XHR posts, why don't specify it to be cross-browser ?

Changed March 14, 2011 03:26PM UTC by castevinz@gmail.com comment:4

Sorry, you could test it here : http://jsfiddle.net/vinzweb/H2LdJ/5/

If you change the "Charset encoding" of your browser in ISO-8859-1, you don't see the charset used in the contentType. So you have to refer to the field "X-Requested-With" (XMLHttpRequest) to be sure you are in UTF-8.

Changed December 05, 2011 07:29PM UTC by rodrigo.rosenfeld comment:5

This should be fixed as I experienced real problems with the Chrome browser and a Tomcat server that uses ISO-8859-1 by default when the charset is not explicitly specified.

I'll open a new ticket pointing to this one since I can't reopen it here and no actual answer was given to why this was rejected.

Changed December 06, 2011 11:51AM UTC by addyosmani comment:6

keywords: ajax, charsetajax, charset, needsreview
milestone: 1.4
resolution: worksforme
status: closedreopened

Changed December 06, 2011 11:53AM UTC by addyosmani comment:7

#10953 is a duplicate of this ticket.

Changed March 07, 2012 04:09PM UTC by jaubourg comment:8

resolution: → fixed
status: reopenedclosed

Fixes #4624... 3 years later, people!

Changeset: bd56456b1e886c7b03211212ac3c0a6a310b5cde

Changed March 07, 2012 04:10PM UTC by jaubourg comment:9

milestone: → 1.7.2