Summary: | vCards with utf-8 quoted printable are displayed incorrect | ||
---|---|---|---|
Product: | [Unmaintained] kab3 | Reporter: | Robert Entner <kde> |
Component: | general | Assignee: | Tobias Koenig <tokoe> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | normal | CC: | gronslet |
Priority: | NOR | ||
Version: | 3.1 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Problematic .vcf file, generated by Ximian Evolution
Zipped version of a problematic .vcf file including utf8 and quoted printable exported with ximian evoltuion |
Description
Robert Entner
2004-01-11 11:29:03 UTC
Subject: kdelibs/kabc/vcardparser CVS commit by tokoe: Fixed the handling of vCard 2.1 with quoted-printable and charset=utf-8. That fixes #72380. CCMAIL:72380-done@bugs.kde.org M +14 -1 vcardparser.cpp 1.12 --- kdelibs/kabc/vcardparser/vcardparser.cpp #1.11:1.12 @@ -73,6 +73,12 @@ VCard::List VCardParser::parseVCards( co QStringList pair = QStringList::split( '=', params[i] ); if ( pair.size() == 1 ) { + // correct the fucking 2.1 'standard' + if ( pair[0].lower() == "quoted-printable" ) { + pair[0] = "encoding"; + pair[1] = "quoted-printable"; + } else { pair.prepend( "type" ); } + } //This is pretty much a faster pair[1].contains( ',' )... if ( pair[1].find( ',' ) != -1 ) { // parameter in type=x,y,z format @@ -93,5 +99,12 @@ VCard::List VCardParser::parseVCards( co else if ( vCardLine.parameter( "encoding" ).lower() == "quoted-printable" ) KCodecs::quotedPrintableDecode( input, output ); - vCardLine.setValue( output ); + + if ( vCardLine.parameter( "charset" ).lower() == "utf-8" ) { + vCardLine.setValue( QString::fromUtf8( output.data(), output.size() ) ); + } else { + vCardLine.setValue( QString::fromAscii( output.data(), output.size() ) ); + } + } else if ( vCardLine.parameter( "charset" ).lower() == "utf-8" ) { + vCardLine.setValue( QString::fromUtf8( value.ascii() ) ); } else vCardLine.setValue( value.replace( "\\n", "\n" ) ); The problem still persists. I attached a .vcf file for testing. Created attachment 4912 [details]
Problematic .vcf file, generated by Ximian Evolution
Created attachment 4913 [details]
Zipped version of a problematic .vcf file including utf8 and quoted printable exported with ximian evoltuion
On Fri, Feb 27, 2004 at 10:54:16AM -0000, Robert Entner wrote:
Hi Robert,
> ------- Additional Comments From kde mail1 entner net 2004-02-27 11:54 -------
> Created an attachment (id=4913)
> --> (http://bugs.kde.org/attachment.cgi?id=4913&action=view)
> Zipped version of a problematic .vcf file including utf8 and quoted printable
> exported with ximian evoltuion
I can import this vCard without problem with KAddressBook/kdelibs from
CVS HEAD. It's really fixed.
Ciao,
Tobias
I tried the attached vcard in comment #4, and it imported correctly when using the default resource, but if I import to my imap resource (through kmail), the non-ascii characters are garbled (by two boxes). Any hints on how to fix this would be greatly appreciated as a majority of my contacts have non-ascii characters. kdepim-3.5.9-10.fc9.i386 Kontact: 1.2.9 KAddressBook: 3.5.9 KMail: 1.9.9 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. |