Re: Handling mislabeled emails encoded with Windows-1252

Subject: Re: Handling mislabeled emails encoded with Windows-1252

Date: Sat, 28 Jul 2018 13:22:46 +0200

To: Jeffrey Stedfast,


From: Sebastian Poeplau

Hi all,

Here's the updated patch. It filters the message through the
GMimeFilterWindows that Jeff mentioned and then uses the charset it
detects for GMimeFilterCharset in the actual rendering of the message.

Jeff, is this how to use the filter correctly?


Sebastian Poeplau <> writes:

> Hi Jeff,
>> GMime actually comes with a stream filter (GMimeFilterWindows) which can auto-detect this situation.
>> In this particular case, you'd instantiate the GMimeFilterWindows like this:
>> filter = g_mime_filter_windows_new ("iso-8859-1");
>> "iso-8859-1" being the charset that the content claims to be in.
>> Then you'd pipe the raw (decoded but not converted to utf-8) content though the filter and afterward call g_mime_filter_windows_real_charset (filter) which would return, in this user's case,  "windows-1252".
> Nice, this is exactly what I was looking for! Somehow I missed it when
> checking GMime. I'll adapt my local fix and post the results here.
> Thanks,
> Sebastian
notmuch mailing list