summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/genericwrapper.cpp
authorzautrix <zautrix>2004-11-06 23:30:02 (UTC)
committer zautrix <zautrix>2004-11-06 23:30:02 (UTC)
commit023e0e82dd8bf6421d12492a2dd25534fc43ad31 (patch) (side-by-side diff)
treecf0533e3ccc642cb57a41953f184f457fa5365ba /kmicromail/libmailwrapper/genericwrapper.cpp
parentf8841c92d5251f713eb7a025af8fdee52de45b3d (diff)
downloadkdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.zip
kdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.tar.gz
kdepimpi-023e0e82dd8bf6421d12492a2dd25534fc43ad31.tar.bz2
many ompi fixes
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
}
b = QString(res->Content());
delete res;
+ size_t index = 0;
+ char*resu = 0;
+ int err = MAILIMF_NO_ERROR;
+ QString charset = part->searchParamter( "charset");
+ qDebug("CHARSET %s ",charset.latin1() );
+ if ( !charset.isEmpty() ) {
+ err = mailmime_encoded_phrase_parse(charset.latin1(),
+ b.latin1(), b.length(),&index, "utf-8",&resu);
+ if (err == MAILIMF_NO_ERROR && resu && strlen(resu)) {
+ //qDebug("res %d %s ", index, resu);
+ b = QString::fromUtf8(resu);
+ }
+ if (resu) free(resu);
+ }
target->setBodytext(b);
target->setDescription(part);
} else {
@@ -344,7 +358,7 @@ QString Genericwrapper::parseMailbox( mailimf_mailbox *box )
if ( box->mb_display_name == NULL ) {
result.append( box->mb_addr_spec );
} else {
- result.append( convert_String(box->mb_display_name).latin1() );
+ result.append( convert_String(box->mb_display_name) );
result.append( " <" );
result.append( box->mb_addr_spec );
result.append( ">" );