From 3479159c7ff5c918af12e29a32367843f336b57f Mon Sep 17 00:00:00 2001 From: Slávek Banko Date: Sun, 25 Mar 2018 20:20:07 +0200 Subject: kmail: Avoid setting charset on non-textual parts of emails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- kmail/kmmessage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'kmail/kmmessage.cpp') diff --git a/kmail/kmmessage.cpp b/kmail/kmmessage.cpp index c33fdf6a..d9961478 100644 --- a/kmail/kmmessage.cpp +++ b/kmail/kmmessage.cpp @@ -3055,8 +3055,11 @@ void applyHeadersToMessagePart( DwHeaders& headers, KMMessagePart* aPart ) DwParameter *param = ct.FirstParameter(); while(param) { - if (!tqstricmp(param->Attribute().c_str(), "charset")) - aPart->setCharset(TQCString(param->Value().c_str()).lower()); + if (!tqstricmp(param->Attribute().c_str(), "charset")) { + if (aPart->type() == DwMime::kTypeText) { + aPart->setCharset(TQCString(param->Value().c_str()).lower()); + } + } else if (!tqstrnicmp(param->Attribute().c_str(), "name*", 5)) aPart->setName(KMMsgBase::decodeRFC2231String(KMMsgBase::extractRFC2231HeaderField( param->Value().c_str(), "name" ))); else { -- cgit v1.2.3