https://bugs.kde.org/show_bug.cgi?id=189139

           Summary: decodeRFC2047String() doesn't parse stuff correctly
           Product: kdepimlibs
           Version: unspecified
          Platform: Unlisted Binaries
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: kmime
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=32701)
 --> (http://bugs.kde.org/attachment.cgi?id=32701)
decodeRFC2047String.patch

I'm using a copy of trunk/KDE/kdepimlibs/kimap/rfccodecs.cpp in my private
project. I've done only minimal modifications for it to integrate into a
non-KDE environment.

The following code fails:

    QByteArray input = "From: =?UTF-8?B?UGF2ZWwgS29sw6HFmQ==?= <f...@bar>";
    qDebug() << input << KIMAP::decodeRFC2047String( input );
    input = "From: =?UTF-8?B?SmFuIEt1bmRyw6F0?= <[email protected]>";
    qDebug() << input << KIMAP::decodeRFC2047String( input );
    input = "From: =?ISO-8859-1?Q?Jan_Kundr=E1t?= <[email protected]>";
    qDebug() << input << KIMAP::decodeRFC2047String( input );
    input = "Subject:
=?utf-8?b?YmzDqXNtcnQgxJvFocSNxZnFvsO9w6HDrcOpIOygoO2IrOyXkOyEnA==?=\n"
 "=?utf-8?b?IOyekOuwlOulvCDsgqzsmqntlZjripQg6rKD7JeQIOuMgO2VnA==?=\n"
 "=?utf-8?b?IOyCrOyaqeyekOyZgCDqsJzrsJzsnpDrpbwg7JyE7ZWc?=\n"
 "=?utf-8?b?IOyngOy5qOyEnA==?=";
    qDebug() << input << KIMAP::decodeRFC2047String( input );

What I got with version from KDE:

"From: =?UTF-8?B?UGF2ZWwgS29sw6HFmQ==?= <f...@bar>" "From:  <f...@bar>"
"From: =?UTF-8?B?SmFuIEt1bmRyw6F0?= <[email protected]>" "From:  
<[email protected]>"
"From: =?ISO-8859-1?Q?Jan_Kundr=E1t?= <[email protected]>" "From: 
<[email protected]>"
"Subject: =?utf-8?b?YmzDqXNtcnQgxJvFocSNxZnFvsO9w6HDrcOpIOygoO2IrOyXkOyEnA==?=
=?utf-8?b?IOyekOuwlOulvCDsgqzsmqntlZjripQg6rKD7JeQIOuMgO2VnA==?=
=?utf-8?b?IOyCrOyaqeyekOyZgCDqsJzrsJzsnpDrpbwg7JyE7ZWc?=
=?utf-8?b?IOyngOy5qOyEnA==?=" "Subject:


"


What was the correct result (a lot of funny Unicode characters follows):

"From: =?UTF-8?B?UGF2ZWwgS29sw6HFmQ==?= <f...@bar>" "From: Pavel Kolář
<f...@bar>"
"From: =?UTF-8?B?SmFuIEt1bmRyw6F0?= <[email protected]>" "From: Jan Kundrát
<[email protected]>"
"From: =?ISO-8859-1?Q?Jan_Kundr=E1t?= <[email protected]>" "From: Jan Kundrát
<[email protected]>"
"Subject: =?utf-8?b?YmzDqXNtcnQgxJvFocSNxZnFvsO9w6HDrcOpIOygoO2IrOyXkOyEnA==?=
=?utf-8?b?IOyekOuwlOulvCDsgqzsmqntlZjripQg6rKD7JeQIOuMgO2VnA==?=
=?utf-8?b?IOyCrOyaqeyekOyZgCDqsJzrsJzsnpDrpbwg7JyE7ZWc?=
=?utf-8?b?IOyngOy5qOyEnA==?=" "Subject: blésmrt ěščřžýáíé 젠투에서
 자바를 사용하는 것에 대한
 사용자와 개발자를 위한
 지침서"

These data are taken from read-world mails (some of them were in fact generated
by KMail). The attached patch fixes the problem.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Kdepim-bugs mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kdepim-bugs

Reply via email to