Is there any effective difference between
Content-Encoding: UTF-8
Content-Type: text/html; charset=utf-8
?
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
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.
I'm not even sure if UTF-8
makes any sense as a value for the Content-Encoding
.