Re: Handling mislabeled emails encoded with Windows-1252

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

Date: Tue, 24 Jul 2018 16:19:20 +0200

To: Jeffrey Stedfast, notmuch@notmuchmail.org

Cc:

From: Sebastian Poeplau


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
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: