[Bug 271859] New: vCard logical lines folded in the middle of utf-8 character

Andrey Bondarenko abondarenko at users.sourceforge.net
Wed Apr 27 17:11:30 BST 2011


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

           Summary: vCard logical lines folded in the middle of utf-8
                    character
           Product: kdepimlibs
           Version: 4.5
          Platform: Ubuntu Packages
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: kabc
        AssignedTo: kdepim-bugs at kde.org
        ReportedBy: abondarenko at users.sourceforge.net


Created an attachment (id=59372)
 --> (http://bugs.kde.org/attachment.cgi?id=59372)
a test vcard (properly folded)

Version:           4.5 (using KDE 4.5.5) 
OS:                Linux

If a contact information saved as a VCard 3.0 (RFC 2425 / 2426) file with
multibyte encoding (utf-8 in my case) it is possible to have lines folded in
the middle of multibyte character. Some bytes of a character left on one line,
the rest are put on the next line. This makes difficult to read saved vcard
with other libraries (python-vobject for example).

I suppose this is a bug because RFC 2425 states following in "5.8.1. Line
delimiting and folding":

  A logical line MAY be continued on the next physical line anywhere
   between two characters by inserting a CRLF immediately

So splitting a line in the middle of the character is not compatible with RFC
2425 requirements.

The cause of the bug is in kabc/vcardparser/vcardparser.cpp, function
createVCard lines 291-301 (git revision
5ca796151e8fbf0e8b84574c9640a77af49c2c50). Folding is done on a byte level,
after unicode characters are encoded as bytes.



Reproducible: Always

Steps to Reproduce:
Set locale to utf-8 based. Create contact in kaddressbook with long note (70+
characters) in some language whose characters are encoded into multiple bytes.
Export contact as vcard 3.0. Try to load a vcard in some other program.

Actual Results:  
a Vcard exported by kaddressbook (look for broken characters):

BEGIN:VCARD
FN:test
N:test;;;;
NOTE:Длинный комментарий на русском языке\,
  чтобы в результате получилась строка бо�
 �ее 70 символов.
UID:MeYEG83HLw
VERSION:3.0
END:VCARD


Expected Results:  
a properly folded vcard:

BEGIN:VCARD
FN:test
N:test;;;;
NOTE:Длинный комментарий на русском яз
 ыке\, чтобы в результате получилась с
 трока более 70 символов.
UID:MeYEG83HLw
VERSION:3.0
END:VCARD

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Kdepim-bugs mailing list