Bug 310137

Summary: Unicode corruption bug when saving vcard
Product: Akonadi Reporter: Antonis Kanouras <antonis+kdebugs>
Component: DAV ResourceAssignee: kdepim bugs <kdepim-bugs>
Severity: normal CC: antonis+kdebugs, greg, tokoe
Priority: NOR    
Version: 4.9   
Target Milestone: ---   
Platform: Ubuntu Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.2

Description Antonis Kanouras 2012-11-15 09:52:17 UTC
I'm not sure if the DAV resource is responsible for this, here goes anyway.
I can reliably reproduce this bug in KDE 4.9.2-3 with the Radicale CalDAV/CardDAV server.

Under some circumstances, if the Notes field of a contact contains non-ascii characters (I assume, I'm writing Greek in it), any non-ascii character in the *whole* contact (not only in the Notes field) will be corrupted.

Reproducible: Always

Steps to Reproduce:
1. Create a new contact under a DAV resource's contacts folder
2. Fill its notes field with the following string: "αβγδεζηθικλμνξοπρστυφχψωαβγδεζηθικλμνξοπρστυφχψωαβγδεζηθικλμνξοπρστυφχψωα" (unquoted of course)
3. Save the contact, and wait for it to be transmitted to the CardDAV server
Actual Results:  
The contact is transmitted corrupted to the server and Akonadi is none the wiser.

Expected Results:  
The contact is transmitted intact to the server.

I've noticed that these contacts when exported from Kaddressbook (or by looking at .local/share/contacts/) tend to break wide characters between lines. They are imported correctly however.

I don't think this is server specific, however a "pip install radicale" should be enough for you to reproduce the bug; the server can be run right after being downloaded without configuration, and using a URL such as "http://localhost:5232/myuser/mycontacts.vcf/".

Feel free to ask me for more details.
Comment 1 Antonis Kanouras 2012-11-15 10:37:55 UTC
A netword trace showed I was a bit trigger-happy with the report.

The vcard is transmitted with wide characters broken between lines (at 79 chars no matter what), which makes the server corrupt the whole card. That's next up for investigation.

Downgrading and trying to reassign. Sorry for the noise.
Comment 2 Grégory Oestreicher 2013-03-06 19:13:47 UTC
Hi Antonis,

I just saw this report dating back 4 months today, sorry. Which software did you originally assign it to? I don't want to create a loop, but I don't think the problem comes from the resource as it doesn't touch the data it's transmitting. The problem may be in KCalCore, but if the folks from there say the resource is the culprit then I'll have another look.

Oh, I can reproduce the issue with SOGo BTW: it flatly refuses to create the contact…

Comment 3 Grégory Oestreicher 2013-03-18 22:36:36 UTC
Git commit d3384b37acc7245ecb8bc4db53af58c7151f5799 by Grégory Oestreicher.
Committed on 18/03/2013 at 23:35.
Pushed by goestreicher into branch 'KDE/4.10'.

Convert VCard to UTF-8
FIXED-IN: 4.10.2

M  +3    -1    resources/dav/common/davutils.cpp