0

If I send a HTML page with UTF-8 encoding which contains a form, is it correct that the browser does not specify the encoding in the POST request header parameters?

I have tested it with the current version of Firefox 18 and Internet Explorer 9 (see below).

Based on the answer to Why does POST not honor charset, but an AJAX request does? tomcat 6, setting the HTML page encoding 'will set the response encoding to UTF-8 and set the response header to UTF-8'.

In my tests, the response headers did not specify that the form values are encoded in UTF-8.

Is this as specified?

Request: POST /demo/form.html HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://127.0.0.1:8080/demo/form.html
Accept-Language: de
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: 127.0.0.1:8080
Content-Length: 29
Connection: Keep-Alive
Cache-Control: no-cache
4

1 回答 1

1

application/x-www-form-urlencoded 媒体类型没有字符集参数,因此浏览器行为是正确的。

于 2013-02-08T19:36:43.403 回答