unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jeffrey Stedfast <jestedfa@microsoft.com>
To: Sebastian Poeplau <sebastian.poeplau@eurecom.fr>,
	"notmuch@notmuchmail.org" <notmuch@notmuchmail.org>
Subject: Re: Handling mislabeled emails encoded with Windows-1252
Date: Sat, 28 Jul 2018 12:25:42 +0000	[thread overview]
Message-ID: <9C0F603A-6125-4CF0-8AE7-E02301355906@microsoft.com> (raw)
In-Reply-To: <87zhyby589.fsf@eurecom.fr>

Hi Sebastien,

Yes, that looks good. I would have probably unreffed the null_stream and null_stream_filter inside of that if-block rather than at the end of the function, but that's a stylistic issue that the notmuch authors can comment on. The patch as it stands should work correctly from what I can tell __ 

As an added optimization, you could try limiting that block of code to just when the charset is one of the iso-8859-* charsets.

The following code snippet should help with that:

charset = charset ? g_mime_charset_canon_name (charset) : NULL;
if (wrapper && charset && g_ascii_strncasecmp (charset, "iso-8859-", 9)) {
    ...

The reason you need to use g_mime_charset_canon_name (if you decide to add the optimization) is that mail software does not always use the canonical form of the various charset names that they use. Often you will get stuff like "latin1" or "iso_8859-1".

Hope that helps,

Jeff

On 7/28/18, 7:22 AM, "Sebastian Poeplau" <sebastian.poeplau@eurecom.fr> wrote:

    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?
    
    Cheers,
    Sebastian
    
    
    


  reply	other threads:[~2018-07-28 12:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-14 12:40 Handling mislabeled emails encoded with Windows-1252 Sebastian Poeplau
2018-07-24  1:49 ` David Bremner
2018-07-24  8:00   ` Sebastian Poeplau
2018-07-24 13:55     ` Sebastian Poeplau
2018-07-24 14:09   ` Jeffrey Stedfast
2018-07-24 14:19     ` Sebastian Poeplau
2018-07-28 11:22       ` Sebastian Poeplau
2018-07-28 12:25         ` Jeffrey Stedfast [this message]
2018-07-30  7:28           ` Sebastian Poeplau
2018-07-30  7:47             ` Sebastian Poeplau
2018-07-31  9:07               ` David Bremner
2018-07-31  9:49                 ` Sebastian Poeplau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9C0F603A-6125-4CF0-8AE7-E02301355906@microsoft.com \
    --to=jestedfa@microsoft.com \
    --cc=notmuch@notmuchmail.org \
    --cc=sebastian.poeplau@eurecom.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).