From 023e0e82dd8bf6421d12492a2dd25534fc43ad31 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 06 Nov 2004 23:30:02 +0000 Subject: many ompi fixes --- (limited to 'kmicromail/libmailwrapper/genericwrapper.cpp') 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( ">" ); -- cgit v0.9.0.2