GNOME Bugzilla – Bug 666896
Workaround Improper GB-2312 Mail Encodings
Last modified: 2012-04-11 16:15:11 UTC
Created attachment 204254 [details] Mail with bad GB-2312 encodings Some mail clients (it seems both gmail on Windows and Outlook do this, but not on all machines) improperly send messages indicating that they are encoded in the GB-2312 charset while including characters only valid in the GB-18030 charset. The mail headers have the following set so I think Evolution is correct in setting the GB-2312 charset, it's just that some mail clients set the headers improperly. Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: base64 As the messages come from poorly configured Windows systems, I'm not entirely sure how to reproduce it. I have however simulated the bug by forcing Evolution's composer to use the GB-2312 charset, pasting in some GB-18030-only characters, sending the mail to myself, and saving the resulting mail as mbox. It's attached. There is a bug submitted on this, but the submitter seems confused and doesn't provide a patch (and it's 4 years old and still unconfirmed), so I created a new report. Sorry if that was wrong. https://bugzilla.gnome.org/show_bug.cgi?id=446783
Created attachment 204255 [details] [review] Use GB-18030 instead of GB-2312 for all messages Attached is a patch that sets all GB-2312 encoded messages to be decoded as GB-18030 messages instead. According to wikipedia GB-18030 is a superset of GB-2312, so I think it's reasonable to decode all GB-2312 encoded messages as GB-18030. The patch applies and works properly for the already-patched sources Gentoo uses to build 2.32.3, but it's only a 5 lines change to a lookup table so I think it should be OK.
*** Bug 446783 has been marked as a duplicate of this bug. ***
Patch reviewer: Please also check the discussions in bug 446783
Thanks for a patch. I would attach it to the original bug report, especially if I knew it, though this way it works too. The patch itself works fine (I do not read Chinese, but there shown more "letters" with your patch). I'll commit it.
Created commit 241edbd in eds master (3.5.1+) Created commit 6d2ac17 in eds gnome-3-4 (3.4.1+)