From: Kevin McCarthy Date: Sun, 23 Oct 2016 22:11:56 +0000 (-0700) Subject: Perform charset conversion on text attachments when piping. (closes #3773) (see ... X-Git-Tag: neomutt-20170225~32^2~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00d1d038655a66adc263d29531ad237519a552f8;p=neomutt Perform charset conversion on text attachments when piping. (closes #3773) (see #3886) When piping a text attachment, there is no reliable way to know the charset used. Vincent Lefèvre says: It was decided in the past that when there is no information on the charset in a transmission to an external command (e.g. as for mail composing), texts are expected to be transmitted in the local charset. Add a MUTT_CHARSET flag to enable charset conversion on text attachments for both when $attach_split is set and unset. --- diff --git a/attach.c b/attach.c index 84cdf6d14..3898fa393 100644 --- a/attach.c +++ b/attach.c @@ -620,6 +620,8 @@ int mutt_pipe_attachment (FILE *fp, BODY *b, const char *path, char *outfile) STATE s; memset (&s, 0, sizeof (STATE)); + /* perform charset conversion on text attachments when piping */ + s.flags = MUTT_CHARCONV; if (outfile && *outfile) thepid = mutt_create_filter_fd (path, &s.fpout, NULL, NULL, -1, out, -1); diff --git a/recvattach.c b/recvattach.c index fb3131889..9d2cc8b6c 100644 --- a/recvattach.c +++ b/recvattach.c @@ -672,6 +672,8 @@ void mutt_pipe_attachment_list (FILE *fp, int tag, BODY *top, int filter) buf[0] = 0; memset (&state, 0, sizeof (STATE)); + /* perform charset conversion on text attachments when piping */ + state.flags = MUTT_CHARCONV; if (mutt_get_field ((filter ? _("Filter through: ") : _("Pipe to: ")), buf, sizeof (buf), MUTT_CMD) != 0 || !buf[0])