Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Does firefox add charset=utf-8 to the ContentType request header

  • 3 replies
  • 12 have this problem
  • 12 views
  • Last reply by karega

more options

Hi, I've noticed whilst developing for an ATG application that AJAX post requests from Firefox seem to have charset=utf-8 appended to the end of the ContentType request header. This is having an effect on requests that contain UTF-8 characters (strangely!). (For info, the header is ContentType: application/x-www-form-urlencoded; charset=UTF-8).

For example, issuing a request that contains the text 용산구 서초2동 1308-25 and using Chrome, the text is stored in the correct format in the DB. However, in FF4 (and I think all 3.x versions) the same text is garbled in the DB. Now, I don't know if the problem is Firefox or perhaps the JBOSS server we use (4.3 EAP) or perhaps the ATG application itself but I'll be asking the same in those forums too. If I use a tool like WebScarab to intercept the request, I can remove the charset from the ContentType and the text is saved correctly.

Other info: XHR request sent using the DOJO 1.3 library.

Just wondering if it is indeed Firefox adding the charset parameter and if there is a programmatic way to prevent it.

Hi, I've noticed whilst developing for an ATG application that AJAX post requests from Firefox seem to have charset=utf-8 appended to the end of the ContentType request header. This is having an effect on requests that contain UTF-8 characters (strangely!). (For info, the header is ContentType: application/x-www-form-urlencoded; charset=UTF-8). For example, issuing a request that contains the text 용산구 서초2동 1308-25 and using Chrome, the text is stored in the correct format in the DB. However, in FF4 (and I think all 3.x versions) the same text is garbled in the DB. Now, I don't know if the problem is Firefox or perhaps the JBOSS server we use (4.3 EAP) or perhaps the ATG application itself but I'll be asking the same in those forums too. If I use a tool like WebScarab to intercept the request, I can remove the charset from the ContentType and the text is saved correctly. Other info: XHR request sent using the DOJO 1.3 library. Just wondering if it is indeed Firefox adding the charset parameter and if there is a programmatic way to prevent it.

All Replies (3)

more options

A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.
The helpers at that forum are more knowledgeable about web development issues.
You need to register at the mozillaZine forum site in order to post at that forum.

See http://forums.mozillazine.org/viewforum.php?f=25

more options

Thanks very much, I wasn't aware of that forum - I'll go investigate.

Matt

more options

Instead of sending your serialized data through the data argument, try sending it over the url argument, appended to the target url.

http://jsfiddle.net/9f36e/2/

Modified by karega