The accept-charset属性指定用于表单提交的字符编码。在对表单提交数据进行编码时,该属性会覆盖页面 header 字段中指定的 html 页面的默认编码。服务器如何知道使用哪种编码来对表单提交的数据进行编码?浏览器是否发送任何请求 header 来指定编码类型?
最佳答案
HTML5 suggests this as a form input value:
_charset_
This value, if used as the name of a Hidden control with no value attribute, is automatically given a value during submission consisting of the submission character encoding.
快速测试似乎表明它在浏览器中得到了很好的支持,至少回到 IE7。
关于html - html 形式的accept-charset 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13541988/