Content-Type ... charset = X和Content-Encoding = X之间有什么区别? [英] What is the difference between Content-Type...charset=X and Content-Encoding=X?

查看:271
本文介绍了Content-Type ... charset = X和Content-Encoding = X之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

内容编码意味着整个身体已经以某种方式被编码压缩)。此标题的典型值为 gzip deflate 。此消息的接收者应解码(例如解压缩)身体以获取原始消息。

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 receipent 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆