diff options
-rw-r--r-- | pith/detach.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pith/detach.c b/pith/detach.c index b9f50a52..298095dd 100644 --- a/pith/detach.c +++ b/pith/detach.c @@ -219,6 +219,17 @@ detach(MAILSTREAM *stream, /* c-client stream to use */ charset = cpystr(ps_global->VAR_UNK_CHAR_SET); } + /* some messages are mislabeled as iso-8859-1 when in reality + * they are windows-1252, so we treat them as windows-1252 + * from the beginning. If we did not make this change, we might + * see '?' characters in the message, without an apparent explanation + * of this fact. + */ + if(charset && !strucmp(charset, "iso-8859-1")){ + fs_give((void **) &charset); + charset = cpystr("windows-1252"); + } + /* convert to UTF-8 */ if(!(charset && !strucmp(charset, "utf-8"))) gf_link_filter(gf_utf8, gf_utf8_opt(charset)); |