From c7e14ba2c2ac2a858539dcb4f077d8fb03988c06 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sat, 15 Dec 2018 22:00:55 -0700 Subject: * 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 displayed message, without an apparent explanation of this fact. Reported by Holger Trapp. --- pith/detach.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)); -- cgit v1.2.3-54-g00ecf