且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

multipart / form-data,字段的默认字符集是什么?

更新时间:2022-01-18 07:57:37

HTTP 1.1 的默认字符集是ISO-8859- 1(Latin1),我猜这也适用于此。

The default charset for HTTP 1.1 is ISO-8859-1 (Latin1), I would guess that this also applies here.


3.7.1规范化和文本默认值

3.7.1 Canonicalization and Text Defaults

- snip -

--snip--


使用charset参数使用某些媒体类型来定义数据的字符集(第3.4节)。当发送方未提供显式字符集参数时,文本类型的媒体子类型被定义为在通过HTTP接收时具有默认字符集值ISO-8859-1。除ISO-8859-1或其子集之外的字符集中的数据必须用适当的字符集值标记。有关兼容性问题,请参阅第3.4.1节。

The "charset" parameter is used with some media types to define the character set (section 3.4) of the data. When no explicit charset parameter is provided by the sender, media subtypes of the "text" type are defined to have a default charset value of "ISO-8859-1" when received via HTTP. Data in character sets other than "ISO-8859-1" or its subsets MUST be labeled with an appropriate charset value. See section 3.4.1 for compatibility problems.