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:07 +0200
commit3479159c7ff5c918af12e29a32367843f336b57f (patch)
tree51f02c82108522fccf6ece95e926dfa29a1a8dc3 /kmail/kmmessage.cpp
parent8996740084e6d31d323cfeb1a269f8427ff3f6bf (diff)
downloadtdepim-3479159c7ff5c918af12e29a32367843f336b57f.tar.gz
tdepim-3479159c7ff5c918af12e29a32367843f336b57f.zip
kmail: Avoid setting charset on non-textual parts of emails
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
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 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 {