Bug 383934 - DAV-Groupware resource for OwnCloud uses incorrect encoding for column "address" (not UTF-8)
Summary: DAV-Groupware resource for OwnCloud uses incorrect encoding for column "addre...
Status: CONFIRMED
Alias: None
Product: kaddressbook
Classification: Applications
Component: general (show other bugs)
Version: 5.11.2
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-23 23:01 UTC by MichaelOF
Modified: 2019-06-16 17:11 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot from kaddressbook: Imported Contact, created in Owncloud: Umlauts CORRECT (11.85 KB, image/png)
2017-08-27 17:18 UTC, MichaelOF
Details
BLOB content from OwnCloud (OC_CARDS.CARDDATA), exported from phpMyAdmin with Firefox 52.3.0 (Umlauts CORRECT in kaddressbook) (172 bytes, application/octet-stream)
2017-08-27 17:22 UTC, MichaelOF
Details
Screenshot from kaddressbook: Imported Contact, changed in Android: Umlauts correct in Name, INCORRECT in Address (12.00 KB, image/png)
2017-08-27 17:24 UTC, MichaelOF
Details
BLOB content from OwnCloud (OC_CARDS.CARDDATA), exported from phpMyAdmin with Firefox 52.3.0 (Umlauts INCORRECT in kaddressbook) (304 bytes, application/octet-stream)
2017-08-27 17:25 UTC, MichaelOF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MichaelOF 2017-08-23 23:01:10 UTC
Using kAddressBook with a DAV-Groupware resource to sync with cardDAV contacts store in my OwnCloud instance, on my private VPS. Both VPS and kAddressBook "client" are OpenSuse 42.3, Plasma 5.8.7.

EVERYTHING set to UTF-8, including Apache, MariaDB/MySQL etc., both on VPS and local KDE client.

Wrong encoding, non-UTF-8, in kaddressbook. E.g. German Umlaut "ü" is shown as "ü"

No issue when syncing with 
- Android Contacts (using DAVdroid)
- iPad Contacts(even with bloody old iOS)
- Thunderbird AddressBook (with Inverse SOGo connector)
Comment 1 Allen Winter 2017-08-27 15:18:32 UTC
I can't reproduce this in version 5.6.0 
I see ä and ö just fine , in contact names at least.

I'm using CardDAV from Kolab
Comment 2 MichaelOF 2017-08-27 17:18:45 UTC
Created attachment 107548 [details]
Screenshot from kaddressbook: Imported Contact, created in Owncloud: Umlauts CORRECT
Comment 3 MichaelOF 2017-08-27 17:22:07 UTC
Created attachment 107549 [details]
BLOB content from OwnCloud (OC_CARDS.CARDDATA), exported from phpMyAdmin with Firefox 52.3.0 (Umlauts CORRECT in kaddressbook)
Comment 4 MichaelOF 2017-08-27 17:24:21 UTC
Created attachment 107550 [details]
Screenshot from kaddressbook: Imported Contact, changed in Android: Umlauts correct in Name, INCORRECT in Address
Comment 5 MichaelOF 2017-08-27 17:25:44 UTC
Created attachment 107551 [details]
BLOB content from OwnCloud (OC_CARDS.CARDDATA), exported from phpMyAdmin with Firefox 52.3.0 (Umlauts INCORRECT in kaddressbook)
Comment 6 Allen Winter 2017-08-27 17:31:53 UTC
confirmed.  for example in the "BLOB content from OwnCloud" I see garbarge in the address when imported and then displayed in KAddressbook
Comment 7 MichaelOF 2017-08-27 17:43:49 UTC
Hi Allen,

just "dug" a little bit more inside and found out that this bug is somewhat "weird".

Steps I tried:

1. created a contact directly in OwnCloud, as OC is single source of truth for all my contacts.
2. waited until kaddressbook got this new contact imported (manual sync / F5 somehow does not work for me, so set interval to "every 2 minutes"). 

Intermediate RESULT: Umlauts in kaddressbook are correct (Screenhot: https://bugs.kde.org/attachment.cgi?id=107548)

3. Synched this new contact via DAVdroid. Umlauts are correct on Android.
4. Changed in AOSP's (native Android) calendar app. Changed in "address" old value "Mühlheim, Hauptstraße" to "Mählheim, Hauptstraße 5"
5. Synched back to OwnCloud via DAVdroid. 

RESULT:
- ALL Umlauts are correct on OwnCloud, as to be seen in Firefox (52.3.0, OpenSuse 42.3)
- ALL Umlauts are correct in e.g. iPad, Thunderbird's addressbook (52.3.0, with SOGo connector) 

- NAME is correct in kaddressbook, although containing umlauts
- ADDRESS is NOT shown correctly in kaddressbook. (Screenshot: https://bugs.kde.org/attachment.cgi?id=107550)

FYI I've also appended OwnCloud's database content, table OC_CARDS, column CARDDATA, datatype BLOB, as "binary attachements" here.

Step 1, kaddressbook CORRECT: https://bugs.kde.org/attachment.cgi?id=107549
Step 5, kaddressbook INCORRECT: https://bugs.kde.org/attachment.cgi?id=107551

I've tested these BLOB-content-file with my programmer's Editor jEdit, both are UTF-8 and MS WIN CR+LF, all umlauts are correct in both file. 
Tested additionaly with kdiff3, which also shows both files, set to UTF-8, correct
Comment 8 Allen Winter 2017-08-27 17:56:08 UTC
I can verify that the address is correct when parsed in the kcontacts library.
somewhere it looses proper encoding when it is display in the widget.

I'm a little fuzzy on where that happens, it might be a grantlee thing.

in vcardtool.cpp, line 830 a print of the address shows:
Address {\n  IsEmpty: false\n  Id: fonC3hteBs\n  Type: Home\n  Post office box: \n  Extended: \n  Street: Mählheim, Hauptstraße 5\n  Locality: \n  Region: \n  Postal code: \n  Country: \n  Label: \n  Geo: Geo {\n  Valid: false\n  Latitude: 91\n  Longitude: 181\n}\n\n}

so I know it is parsed and stored ok.

maybe Laurent knows what happens from there.
Comment 9 MichaelOF 2017-08-27 18:08:55 UTC
not sure if this is of any help, but if I try kaddressbook's "print preview" functionality, the "corrupted" address is shown correctly "again"
Comment 10 MichaelOF 2017-08-27 18:58:55 UTC
last remark for now: 

tested with another field, "notice" (Shown as "Anmerkung" in German kaddressbook): Everything FINE, umlauts shown correctly in kaddressbook for "notice", after changing on Android.

Maybe this bug might be isolated to field "address"?
Comment 11 sourcemaker 2017-08-29 22:13:06 UTC
I can confirm this issue.
In some cases, the address is also displayed incorrectly.

For example:

(correct)
Hauptstraße 1
70178 Stuttgart

(wrong)
Hauptstraße 1\
Stuttgart 70178