3 ms·
Amusing that they couldn't get the encoding correct on their final email either.
by justinjlynn 9y ago
Amusing that they couldn't get the encoding correct on their final email either.
- nneonneo 9y agoIt’s correct in the email I received. It’s a non-ascii apostrophe so I guess certain mail clients might not handle it correctly?
- nvr219 9y agoI copied and pasted from Outlook... probably Outlook's fault honestly.
- LukeShu 9y agoIn the email I received, it's a non-ASCII apostrophe encoded in UTF-8. The email headers say "Content-Type: text/html; charset=iso-8859-1", but then the HTML body says "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>". Clients that give preference to the header will get it wrong. The full raw email: https://lukeshu.com/dump/startcom-email.txt https://lukeshu.com/dump/startcom-email.txt
- justinjlynn 9y agoeh, the header should match the body encoding regardless of meta tag; should it not?
- bound008 9y agoThis is more common than you think.
- LukeShu 9y agoYes, 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.
- cratermoon 9y agoISO-8859-1, aka "Latin 1" is a single-byte encoding but it represents the Unicode codepoints 0-127 (ASCII) in exactly the same way as UTF-8. This is a legacy of Microsoft Windows.