Content-Type...charset=X 和 Content-Encoding=X 有什么区别? [英] What is the difference between Content-Type...charset=X and Content-Encoding=X?
问题描述
两者之间有什么有效的区别
Is there any effective difference between
Content-Encoding: UTF-8
Content-Type: text/html; charset=utf-8
?
推荐答案
可选参数 charset
仅对基于文本的内容有意义(Content-Types
像 text/plain
、text/html
等).并非所有消息都是文本.
Optional parameter charset
makes sense only for text-based content (Content-Types
like text/plain
, text/html
, and such). Not all messages are text.
Content-Encoding
表示整个正文已经以某种方式编码(通常是压缩的).此标头的典型值为 gzip
和 deflate
.此消息的收件人应解码(例如 ungzip)正文以获取原始消息.
Content-Encoding
means that the whole body has been encoded in some way (usually compressed). Typical values for this header are gzip
and deflate
. The recipient of this message should decode (e.g. ungzip) the body to get the original message.
我什至不确定 UTF-8
作为 Content-Encoding
的值是否有意义.
I'm not even sure if UTF-8
makes any sense as a value for the Content-Encoding
.
这篇关于Content-Type...charset=X 和 Content-Encoding=X 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!