html - html 形式的accept-charset 属性

标签 html http-headers

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/

相关文章:

html - HTML 中具有变量替换的三元运算符

html - CSS 页面边框在打印预览页面中不起作用

javascript - 从文本区域获取字符串并将其呈现为 html(电子邮件模板预览)的正确方法是什么?

c# - 调用基础 REST API

android - 如何在 webView 的 url 中发送 referer 请求

android - 如何将请求头添加到 HttpClient 请求?

javascript - 如果使用 Javascript 定位多个元素 ID 并且找不到其中之一,则会出错

Golang 错误的http请求头

ruby-on-rails - HTTP Basic Auth 用户名中的 UTF-8 字符损坏

javascript - 如何在创建之前定义节点的行为?