[英]what is the correct charset for a application/pdf content-type http response header?
I'm looking to see whether this is correct as an HTTP response header 我想看看这是否正确作为HTTP响应标头
Content-Type: application/pdf; charset=ISO-8859-1
or we should be emitting this instead 或者我们应该发出这个
Content-Type: application/pdf
I believe the latter is correct, given this: 我认为后者是正确的,鉴于此:
The "charset" parameter is used with some media types to define the character set (section 3.4) of the data.
“charset”参数与某些媒体类型一起用于定义数据的字符集(第3.4节)。 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.type通过HTTP接收时定义为具有默认字符集值“ISO-8859-1”。 Data in character sets other than "ISO-8859-1" or
除“ISO-8859-1”之外的字符集中的数据
its subsets MUST be labeled with an appropriate charset value.它的子集必须用适当的字符集值标记。
rfc2068 HTTP/1.1rfc2068 HTTP / 1.1
And that rfc3778 The application/pdf Media Type doesn't mention charsets at all. 而rfc3778应用程序/ pdf媒体类型根本没有提到字符集。
This SO discussion is where I started, but isn't specifically about application/pdf: Is it categorically wrong to send a charset parameter with a Content-Type header for non-text media types? 这个SO讨论是我开始的地方,但不是专门针对application / pdf: 对于非文本媒体类型,发送带有Content-Type标头的charset参数是绝对错误的吗?
Can anyone confirm or deny or point me to a better RFC? 任何人都可以确认或否认或指向更好的RFC吗?
There is no charset value applicable. 没有适用的字符集值。 PDF is a binary format which handles character encodings internally, in a way that's not relevant to MIME types at all.
PDF是一种二进制格式,它在内部处理字符编码,其方式与MIME类型完全无关。
You should be sending: 你应该发送:
Content-Type: application/pdf
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.