Use the current charset of the file for the parameter, since the file
hasn't been converted yet.
Co-authored-by: Richard Russon <rich@flatcap.org>
param[z++] = command[x++];
param[z] = '\0';
- pvalue2 = mutt_param_get(&a->parameter, param);
+ /* In send mode, use the current charset, since the message hasn't
+ * been converted yet. */
+ if ((mutt_str_strcasecmp(param, "charset") == 0) && a->charset)
+ pvalue2 = a->charset;
+ else
+ pvalue2 = mutt_param_get(&a->parameter, param);
mutt_str_strfcpy(pvalue, pvalue2, sizeof(pvalue));
if (C_MailcapSanitize)
mutt_file_sanitize_filename(pvalue, false);