Conversation
|
This is not a real fix, just a "it works in more cases" (if the encoding is 8bit Shift-JIS for example this would fail) An intermediate solution would be to have the "global" S22Imap encoding as a setting that can be changed on runtime. An example of this is #96 but that PR has several other changes that makes it "invalid" Some of this is discussed in great detail in #47 |
|
For what it's worth (and I don't meant to beat a dead horse), MimeKit handles undeclared 8-bit text in headers in what I would describe as probably the only real sane way possible. MimeKit's parser optionally takes a The process goes something like this: The parser tries to convert the 8-bit header value[1] into a The reason for this order of preference is that the latest email specifications allow for UTF-8 encoded email headers, and so going forward, it's probably reasonable to try UTF-8 first since that is an accepted standard. Even if it weren't, though, UTF-8 is still a good charset to try first since it is quite common (due largely to the fact that many systems these days use UTF-8 as their default locale charset). The user supplied charset is tried next because if the user selects ISO-8859-1 (since that is their locale charset, perhaps? or because they live in a western country where latin1 is the most common?), ISO-8859-1 will convert any sequence of 8-bit bytes cleanly, whether it really is ISO-8859-1 or not, so it should ONLY be tried last (which is coincidentally why it is the last charset always tried). Now... even if none of those 3 charsets was the correct charset (e.g. maybe the actual charset is Big5 but the user set
|
No description provided.