changeset: 6831:f46ed1718cb4
user:      Kevin McCarthy <[email protected]>
date:      Sun Oct 23 15:11:56 2016 -0700
link:      http://dev.mutt.org/hg/mutt/rev/f46ed1718cb4

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.

diffs (24 lines):

diff -r 688ecc6d5a8d -r f46ed1718cb4 attach.c
--- a/attach.c  Sun Oct 23 14:49:07 2016 -0700
+++ b/attach.c  Sun Oct 23 15:11:56 2016 -0700
@@ -620,6 +620,8 @@
     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 -r 688ecc6d5a8d -r f46ed1718cb4 recvattach.c
--- a/recvattach.c      Sun Oct 23 14:49:07 2016 -0700
+++ b/recvattach.c      Sun Oct 23 15:11:56 2016 -0700
@@ -672,6 +672,8 @@
 
   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])

Reply via email to