Handling mislabeled emails encoded with Windows-1252

Jeffrey Stedfast jestedfa at microsoft.com
Tue Jul 24 07:09:19 PDT 2018


Hi all (sent his to David already using Reply instead of Reply-All, d'oh!),

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".

Hope that helps,

Jeff

On 7/23/18, 9:49 PM, "notmuch on behalf of David Bremner" <notmuch-bounces at notmuchmail.org on behalf of david at tethera.net> wrote:

    Sebastian Poeplau <sebastian.poeplau at eurecom.fr> writes:
    
    > Hi,
    >
    > This email is to suggest a minor change in how notmuch handles text
    > encoding when displaying emails. The motivation is the following: I keep
    > receiving emails that are encoded with Windows-1252 but claim to be
    > ISO 8859-1. The two character sets only differ in the range between 0x80
    > and 0x9F where Windows-1252 contains special characters (e.g. “quotation
    > marks”) while ISO 8859-1 only has non-printable ones. The mislabeling
    > thus causes some special characters in such emails to be displayed with
    > a replacement symbol for non-printable characters.
    
    Hi Sebastian;
    
    Everyone's mail situation is unique, but I haven't noticed this
    problem. Do you have a mechanical (e.g. scripted) way of detecting such
    mails? I suppose it could just look for characters in the range 0x80 to
    0x95 in allegedly ISO_8859-1 messages. A census of the situation in my
    own mail would help me think about this problem, I think.
    
    David
    
    
    _______________________________________________
    notmuch mailing list
    notmuch at notmuchmail.org
    https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fnotmuchmail.org%2Fmailman%2Flistinfo%2Fnotmuch&data=02%7C01%7Cjestedfa%40microsoft.com%7C196f62f02155461e6e2408d5f107b75f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636679937804456911&sdata=bI6deYOaU81RwBFmITjg3G1DPvjgP8xiO5cB%2FKIkz58%3D&reserved=0
    



More information about the notmuch mailing list