3 ms·
Yes, the header should match the body encoding, but it doesn't necessarily have to; that is in part what the <meta http-equiv> tag is for; it may be interpreted
by LukeShu 9y ago
Yes, the header should match the body encoding, but it doesn't necessarily have to; that is in part what the <meta http-equiv> tag is for; it may be interpreted as saying "the value of header is potentially wrong, use this value instead" (of course, the thing says "http-equiv", and in an email, it isn't an HTTP header, it is a MIME header!)
In HTML4/XHTML1, the <meta http-equiv> isn't meant to be interpreted by the user agent; the HTTP server is supposed to parse it and set the the HTTP header accordingly.
Of course, the people writing the (X)HTML probably have a better idea of what encoding they're using than the people configuring the HTTP server, so it's common for user agents to allow <meta http-equiv> to override the actual header, as it allows more things to work "correctly" for users. But, strictly speaking, that is non-conforming.
In (X)HTML5, that practice was codified, and the <meta http-equiv> tag is given preference over the actual headers (for a whitelist of allowed headers).
So, which interpretation is "correct" depends on if it is HTML4/XHTML1 or (X)HTML5.
Now, the MIME type of the email body said "text/html" which can be anything, and the body used the HTML5 doctype, but specified the XHTML1 xmlns. I'm honestly not sure which interpretation is correct in that case.