diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-09-15 17:19:16 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-09-15 17:19:16 +0000 |
commit | 8f42140d643a16ebe27cea943bd8c7bf02d30c9b (patch) | |
tree | 18368ad70530c783c45b15237b28507d62479ae6 | |
parent | bc38f1d80e4e9518b3bf7a720845857e8d19d423 (diff) |
When using mutt_copy_header with CH_TXTPLAIN, generate a
content-type _with_ a character set parameter.
-rw-r--r-- | copy.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -33,6 +33,8 @@ #include <ctype.h> #include <unistd.h> /* needed for SEEK_SET under SunOS 4.1.4 */ +extern char MimeSpecials[]; + static int copy_delete_attach(HEADER *h, HEADER *p, BODY *m, FILE *fpin, FILE *fpout, int flags); @@ -264,7 +266,7 @@ mutt_copy_hdr (FILE *in, FILE *out, long off_start, long off_end, int flags, CH_NOSTATUS ignore the Status: and X-Status: CH_PREFIX quote header with $indent_str CH_REORDER output header in order specified by `hdr_order' - CH_TXTPLAIN generate text/plain MIME headers + CH_TXTPLAIN generate text/plain MIME headers [hack alert.] CH_UPDATE write new Status: and X-Status: CH_UPDATE_LEN write new Content-Length: and Lines: CH_XMIT ignore Lines: and Content-Length: @@ -277,16 +279,21 @@ mutt_copy_hdr (FILE *in, FILE *out, long off_start, long off_end, int flags, int mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix) { + char buffer[SHORT_STRING]; + if (mutt_copy_hdr (in, out, h->offset, h->content->offset, flags, prefix) == -1) return (-1); if (flags & CH_TXTPLAIN) { fputs ("Mime-Version: 1.0\n", out); - fputs ("Content-Type: text/plain\n", out); fputs ("Content-Transfer-Encoding: 8bit\n", out); + fputs ("Content-Type: text/plain; charset=", out); + rfc822_cat(buffer, sizeof(buffer), Charset, MimeSpecials); + fputs(buffer, out); + fputc('\n', out); } - + if (flags & CH_UPDATE) { if ((flags & CH_NOSTATUS) == 0) |