[Kde-pim] Re: kmail + mdn reply + encoding

Thomas McGuire mcguire at kde.org
Tue Jun 28 12:42:16 BST 2011


Hi,

On Monday, June 27, 2011 10:29:31 AM laurent Montel wrote:
> Could you help me to fix bug in encoding ?
>  KMime::MDN::dispositionNotificationBodyContent returns a string which is
> not encoding in utf-8 when I receive notification
> 
> in body I have:
> "Le message envoyé le 27/06/2011 10:27 à  montel at kde.org avec le sujet «Â
> test mdn » a été affiché. Il n'est pas certain qu'il ait été lu ou
> compris"
>
>   // text/plain part:
>   KMime::Content* firstMsgPart = new KMime::Content( m_origMsg.get() );
>   firstMsgPart->contentType()->setMimeType( "text/plain" );
>   firstMsgPart->contentType()->setCharset( "us-ascii" );
>   firstMsgPart->contentTransferEncoding()->from7BitString( "7bit" );
>   firstMsgPart->setBody( description.toUtf8() );
>   receipt->addContent( firstMsgPart );

Apart from the problem Ingo mentioned, the content-transfer-encoding here is 
also wrong. It is set to 7 bit, which only works for US-ASCII (english text 
without special characters), but not for UTF8.
KMail can deal with such a wrongly encoded mail, but other mail clients 
probably can not.
It is basically the same problem as I outlined in my recent mail with the 
subject "KMime::Content::fromUnicodeString() considered harmful".
Looks like not only all fromUnicodeString() calls need to be fixed, but also 
all setBody() calls, since that is basically the same problem.
It would probably be good to have something like 
KMime::Content::setOptimalCTEFromBody() in KMime that we can use.
At the moment I don't have time to look at this myself.

Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110628/f82da28c/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list