[Kde-pim] decodeRFC2047String

Martin Koller kollix at aon.at
Sun Aug 23 16:03:58 BST 2009


On Sunday 23 August 2009, Thomas McGuire wrote:
> 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?

Misunderstanding. What gets dragged is already RFC2047 encoded, but the patch 
is about decoding it back to a QString which can then be displayed correctly.

> 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).

You're right. I was misled by the implementation inside kmime, which calls at 
one point decodeRFC2047String( src, usedCS, "utf-8", false );

-- 
Best regards/Schöne Grüße

Martin    ()  ascii ribbon campaign - against html mail 
          /\                        - against microsoft attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090823/4fa4b575/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