Bug 159795 - Kaddressbook kdepim dimap problem with codepage for umlauts
Summary: Kaddressbook kdepim dimap problem with codepage for umlauts
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kab3
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Koenig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-24 16:09 UTC by Roland Reuß
Modified: 2009-08-05 16:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch, first part (17.83 KB, patch)
2008-09-23 15:48 UTC, Roland Wolters
Details
Secon part of the patch. (12.06 KB, patch)
2008-09-23 15:49 UTC, Roland Wolters
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roland Reuß 2008-03-24 16:09:41 UTC
Version:           3.5.9 (using KDE 3.5.9)
Installed from:    SuSE RPMs
OS:                Linux

System: 
SuSE 10.3 
kdelibs 3.5.9.53.3
kdepim 3.5.9.20.2
Kmail is running with DIMAP
All environment LCs are (since long utf-8)
KDE spelling is (since long) utf-8

Kaddressbook doesn't display special characters, which makes it a mess in zones beyond ASCII 128 -- all the Umlauts and the other suspicious characters are replaced by two rectangles. 

Observations:

If I open an address directly on the server with a text-editor all special characters are correct. 

If I replace the two rectangles by the correct character locally the address shows up correct until I fetch mail next time.

The bug dates back from January 2008. Before that all was OK.

Kalendar and Kmail display all umlauts etc. correctly.

The bug must lie somewhere in the relations between kdelibs and kaddressbook.
Comment 1 Hermann Schwarting 2008-04-23 11:15:17 UTC
I have the same issue. I observed that the vcard file that gets saved on the IMAP server does not denote an encoding and is encoded in latin1. Characters outside ASCII that are representable in latin1 are contained in the file, but displayed wrong by the addressbook. Other characters outside latin1 are saved as literal question marks (\u003f), which is worse. Please allow UTF8 encoding for the vcard files.
[Debian lenny, kdelibs 4:3.5.9.dfsg.1-2, kdepim 4:3.5.9-2, KMail with DIMAP, everything set to UTF-8 since installation]
Comment 2 Tobias G. Pfeiffer 2008-04-27 22:43:58 UTC
*** This bug has been confirmed by popular vote. ***
Comment 3 Tobias G. Pfeiffer 2008-04-27 22:47:18 UTC
I can confirm the problem here (Kubuntu Gutsy, kaddressbook version 4:3.5.9-0ubuntu1~gutsy1~ppa3). Especially weird is that all special characters of other things on the IMAP server (e.g. calendar entries) are correctly displayed, only the contacts are broken.
Comment 4 penguin 2008-04-28 06:26:45 UTC
Problem also in Kubuntu Hardy (kaddressbook version: 4:3.5.9-0ubuntu3)
Comment 5 Florian Beier 2008-05-05 10:40:00 UTC
I can confirm the problem:
After upgrading (kubuntu) to kde 3.5.9, the special characters (Umlaute) are broken. This affects kadressbook and kalender, both in dimap folders.
Comment 6 Florian Beier 2008-05-05 11:05:33 UTC
Sorry, I was wrong: kalender is NOT affected!
Comment 7 Roland Reuß 2008-06-07 15:33:23 UTC
I wrote the bug report in March, the bug dated back from January or so. In the meantime since I installed twenty or more complete kde updates, but nobody reacts. May I kindly ask to react in a way that will help us to deal with the problem. I understand that all the programmers have to deal with KDE 4.0 but then again there is support for KDE 3.5 in other branches.

Roland
Comment 8 Patrick Oltmann 2008-06-13 00:47:43 UTC
Same problem here, also with a DIMAP account.
system: Mandriva 2008.1 x86-64
kontact: 3.5.9-9mdv2008.1
kaddressbook: 3.5.9-9mdv2008.1
kdelib 4: 3.5.9-37.2mdv2008.1

However (in contrast to the initial report) replacement of the two rectangles with the originial Umlaut, followed by apply these changes, only displays the corrected version in the list for approx. 2 seconds. Then the Umlaut is replace by two rectangle again. According to tcpdump, this second replacement is not connected with any data transfer to/from the DIMAP server.
Comment 9 Florian Beier 2008-06-24 19:14:24 UTC
By the way: This bug has nothing to do with SuSE! Same Problem here with kubuntu and gentoo!
Comment 10 Roland Wolters 2008-09-05 11:47:13 UTC
This bug is known to the developers, and is fixed in the KDE 4.1 release. Maybe there will be an unofficial patch for KDE 3.5.x, but that's not entirely clear right now.

For the technical interested people:
The vcard data are read in as a QString, while it should be a QByteArray. With QString every byte is treated like a character, however in utf8 some characters are encoded with two bytes. Therefore the problem.
The obvious fix is to read in the data with QByteArray instead of QString, and that is indeed investigated right now. Since API breakages are not allowed in KDE 3.5.x this is not easy. I will try to keep you up2date on the topic.
Comment 11 Roland Wolters 2008-09-23 15:48:45 UTC
Created attachment 27533 [details]
Patch, first part

First part of the patch. It fixes KAddressbook's problems with umlauts and other special characters exchanged with groupdav servers.
Comment 12 Roland Wolters 2008-09-23 15:49:09 UTC
Created attachment 27534 [details]
Secon part of the patch.

Second part of the patch. It fixes KAddressbook's problems with umlauts and other special characters exchanged with groupdav servers.
Comment 13 Roland Wolters 2008-09-23 15:51:22 UTC
These two patches fix the problem. We made some tests here (patched Debian KDE 3.5.9 packages) and it looks perfect. All problems regarding umlauts (we didn't test with other special characters) are fixed now.

The patches are developer by Tobias König (tokoe), so send him your thanks :)

It is not sure yet if there will be another KDE release in the future - and if that could carry these patches.

Still, for other long-time committed vendors this patch might be interesting.
Comment 14 Roland Reuß 2008-09-23 18:16:02 UTC
Thank, Tobias. I appreciate the effort!

Just for the record: 
I have to apply the patches to the sources (of kabc and kdepim?), yes?
I then have to compile kdepim from the scratch (at least 1 hour on my machine)?
What if the next update of KDE shows up? Will it overwrite the compiled binaries?
And (not intended to be a pia): I see nearly every week new versions of central kde-packages appearing on the OpenSuSE-repositories, every second includes the whole kdepim-thing. Why is it that the patch couldn’t be implemented into the rpms?

Thanks again,
Roland
Comment 15 Roland Wolters 2008-09-23 21:19:13 UTC
You have to apply the patches against the kdepim and against the kdelibs sources. Open the patches in an editor and you see in the first line where they expect which files, that should help you finding out what has to be applied where.
Afterwards, compile kdelibs, install the new version, and compile kdepim and install it.

Any KDE update will overwrite the new files, so the best is to create a patched distribution package with a higher number. Ask someone at your distribution to help you there.

About problems including such patches: the patch does add a total new function, it is not one of the smaller bugfixes which correct minor issues. And it must be made certain that it doesn't change the API! So first there must be an API review, and afterwards the patch can be included.

Can any KDE developer check the patch if the API is touched here or if everything works out?
Comment 16 Roland Reuß 2008-09-24 10:08:58 UTC
Thanks, Roland, that’s useful.

Kdelibs compiles OK, but kdepim3 doesn’t (the patched file ldifvcardcreator.cpp makes problems):

<quote>
/usr/src/packages/BUILD/kdepim-3.5.10/kaddressbook/thumbnailcreator/ldifvcardcreator.cpp:88: error: ‘class KABC::VCardConverter’ has no member named ‘parseVCardsRaw’
Error creating ./kaddressbook/thumbnailcreator/ldifvcardcreator.lo. Exit status 1.
</quote>

Any idea?

Thanks again,
Roland
Comment 17 Roland Wolters 2008-09-24 14:51:56 UTC
Read my comment again: you first have to patch kdelibs, then compile *and* install it.
Only then the patched kdepim will compile.

As a technical note: the error message says that a class is missing - and that exact class was added with the kdelibs patch.
Comment 18 Tobias Koenig 2009-08-05 16:35:45 UTC
The development of the old KAddressBook will be discontinued for KDE 4.4.
Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product.