summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/genericwrapper.cpp
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/genericwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp
index d89a5f9..49227dd 100644
--- a/kmicromail/libmailwrapper/genericwrapper.cpp
+++ b/kmicromail/libmailwrapper/genericwrapper.cpp
@@ -220,6 +220,20 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m
220 } 220 }
221 b = QString(res->Content()); 221 b = QString(res->Content());
222 delete res; 222 delete res;
223 size_t index = 0;
224 char*resu = 0;
225 int err = MAILIMF_NO_ERROR;
226 QString charset = part->searchParamter( "charset");
227 qDebug("CHARSET %s ",charset.latin1() );
228 if ( !charset.isEmpty() ) {
229 err = mailmime_encoded_phrase_parse(charset.latin1(),
230 b.latin1(), b.length(),&index, "utf-8",&resu);
231 if (err == MAILIMF_NO_ERROR && resu && strlen(resu)) {
232 //qDebug("res %d %s ", index, resu);
233 b = QString::fromUtf8(resu);
234 }
235 if (resu) free(resu);
236 }
223 target->setBodytext(b); 237 target->setBodytext(b);
224 target->setDescription(part); 238 target->setDescription(part);
225 } else { 239 } else {
@@ -344,7 +358,7 @@ QString Genericwrapper::parseMailbox( mailimf_mailbox *box )
344 if ( box->mb_display_name == NULL ) { 358 if ( box->mb_display_name == NULL ) {
345 result.append( box->mb_addr_spec ); 359 result.append( box->mb_addr_spec );
346 } else { 360 } else {
347 result.append( convert_String(box->mb_display_name).latin1() ); 361 result.append( convert_String(box->mb_display_name) );
348 result.append( " <" ); 362 result.append( " <" );
349 result.append( box->mb_addr_spec ); 363 result.append( box->mb_addr_spec );
350 result.append( ">" ); 364 result.append( ">" );