[Kde-pim] Re: KMime::Content::fromUnicodeString() considered harmful

Allen Winter winter at kde.org
Wed Jun 22 12:38:30 BST 2011


On Tuesday 21 June 2011 9:03:37 AM Thomas McGuire wrote:
> Hi,
> 
> today I discovered that contrary to the documentation, 
> KMime::Content::fromUnicodeString() does not set the content transfer encoding 
> automatically, it needs to be done by the caller.
> I fixed the documentation now.
> 
Would it make sense to create a new method that forces setting the content transfer encoding
and then deprecated the current method?


> I found the following places in KDEPIM that probably do it wrong and don't set 
> the CTE and should be fixed:
> kdepim/examples/etm_usage/noteviewer.cpp
> kdepim/kalarm/kamail.cpp
> kdepim/messagecomposer/messagefactory.cpp
> 	MessageFactory::createForwardDigestMIME(), for non-English locales
> kdepim/mobile/notes/mainview.cpp
> kdepim/templateparser/templateparser.cpp
> 
> There are likely other places outside of kdepim.git that are affected as well.
> Some callers do it correctly, btw.
> 
> If the content transfer encoding is not set, an invalid mail will be created 
> (KMail can deal with that gracefully, but probably not others).
> It is sufficient to set the CTE to base64, if you want the optimal CTE 
> regarding space and readability use KMime::Util::encodingsForData() and take 
> the first result that is not CE8Bit.
> 
> If you want to know more about KMime, read http://api.kde.org/4.x-
> api/kdepimlibs-apidocs/kmime/html/index.html.
> 
> Regards,
> Thomas
> 

-- 
Allen Winter | allen at kdab.net | Software Engineer
KDAB (USA), LLC, a KDAB Group company
Tel. USA +1-866-777-KDAB(5322), Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
_______________________________________________
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