Bug Tracker

Opened 14 years ago

Closed 11 years ago

Last modified 11 years ago

#4624 closed bug (fixed)

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"

Change History (9)

comment:1 Changed 14 years ago by dmethvin

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?

comment:2 Changed 13 years ago by dmethvin

Resolution: worksforme
Status: newclosed

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

comment:3 Changed 12 years ago by castevinz@…

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 ?

comment:4 Changed 12 years ago by castevinz@…

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.

comment:5 Changed 11 years ago by rodrigo.rosenfeld

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.

comment:6 Changed 11 years ago by addyosmani

Keywords: needsreview added
Milestone: 1.4
Resolution: worksforme
Status: closedreopened

comment:7 Changed 11 years ago by addyosmani

#10953 is a duplicate of this ticket.

comment:8 Changed 11 years ago by jaubourg

Resolution: fixed
Status: reopenedclosed

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

Changeset: bd56456b1e886c7b03211212ac3c0a6a310b5cde

comment:9 Changed 11 years ago by jaubourg

Milestone: 1.7.2
Note: See TracTickets for help on using tickets.