[Kde-pim] decodeRFC2047String

Thomas McGuire mcguire at kde.org
Sun Aug 23 14:50:02 BST 2009


Hi,

On Saturday 22 August 2009 23:26:25 you wrote:
> tying to fix a drag'n drop bug from a mail URL into a AddresseeLineEdit
> (e.g. drop a mailto url with an umlaut to the identity dialog in
> kmail/advanced tab/reply to or BCC field - same problem as bug 138725)
> I wanted to use a decodeRFC2047String method.
> But there are some of them ... :-(
> 
> There is one in KMime, and one in KIMAP.
> Which is the preferred one ? Why are there 2 at all ?
> (kmail uses the one from KMime)
> 
> Also, the latter in KIMAP seems to have a bug: when I drag/drop a mailto
>  url with an umlaut in it, e.g. "Götz" <goetz at gmail.com>
> KIMAP's decode function snippes the Götz and returns "" <goetz at gmail.com>

RFC2047 encoded strings are not allowed to have umlauts, the umlauts need to 
be encoded (which is the whole point of RFC2047).
So KIMAP's error handling in that case is not the best. Does KMime do 
something better?

In the patch, I'm sceptical of the "address.toUtf8()" part, because the 
RFC2047-encoded string should contain only ASCII characters, and never 
anything else. It would fail if the charset of the string would be Japanese 
sjis, instead of Utf8 (although both are wrong).
It should be toAscii(), not to Utf8(). If someone uses un-RFC2047-encoded 
umlauts in mailto addresses, that is wrong, and not our problem.

Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090823/8dab46d7/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