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.
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);
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])