summaryrefslogtreecommitdiffstats
path: root/kmail/kmmessage.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-03-25 20:20:07 +0200
committerSlávek Banko <slavek.banko@axis.cz>2018-03-25 20:20:24 +0200
commitf9301c6c042546a86f28f2ddaccadca7bcf8b9a6 (patch)
tree173ae65f5292e37b3fec32edb26eb22cebc34ed5 /kmail/kmmessage.cpp
parent3f26d326c9bd8fbd60e5d89e20a705c87a837b1f (diff)
downloadtdepim-f9301c6c042546a86f28f2ddaccadca7bcf8b9a6.tar.gz
tdepim-f9301c6c042546a86f28f2ddaccadca7bcf8b9a6.zip
kmail: Avoid setting charset on non-textual parts of emails
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 3479159c7ff5c918af12e29a32367843f336b57f)
Diffstat (limited to 'kmail/kmmessage.cpp')
-rw-r--r--kmail/kmmessage.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/kmail/kmmessage.cpp b/kmail/kmmessage.cpp
index c33fdf6a2..d99614785 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 {