Skip to main content

4.6. 默认字符集的 _charset_ 字段

4.6. The charset Field for Default Charset

🇬🇧 英文原文

Some form-processing applications (including HTML) have conventions that establish a default character encoding for form data. For example, [W3C.REC-html5-20141028] establishes a default encoding via the accept-charset attribute of the form element or the charset of the document carrying the form.

In such cases, a charset field may be used to transmit the value of that default. The charset field, if it exists, should be the first field of the form-data content. Its value is the name of the character encoding used in form field names and values that do not have an explicit charset parameter.

🇨🇳 中文翻译

一些表单处理应用程序(包括 HTML)有为表单数据建立默认字符编码的约定。例如,[W3C.REC-html5-20141028] 通过 form 元素的 accept-charset 属性或携带表单的文档的字符集来建立默认编码。

在这种情况下,可以使用 charset 字段来传输该默认值。charset 字段(如果存在)应该是 form-data 内容的第一个字段。其值是在没有显式 charset 参数的表单字段名称和值中使用的字符编码的名称。