From: Ricardo Mones Date: Wed, 30 Sep 2015 22:28:34 +0000 (+0200) Subject: Fix bug #3524 ‘vCard does not decode all quoted-printable values’ X-Git-Tag: 3.13.0~31 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=76b854fd5e98f225dcee88f17cddebe72ace6683 Fix bug #3524 ‘vCard does not decode all quoted-printable values’ Support vCard 2.1 variants with UTF-8 charset and/or encoding type parameters, which were deprecated in vCard 3.0, but are currently being used in some smartphone contact list exporters. --- diff --git a/src/vcard.c b/src/vcard.c index 378a54dca..514ab4ffb 100644 --- a/src/vcard.c +++ b/src/vcard.c @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun and the Claws Mail team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,13 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /* * Functions necessary to access vCard files. vCard files are used * by GnomeCard for addressbook, and Netscape for sending business - * card information. Refer to RFC2426 for more information. + * card information. Refer to http://www.imc.org/pdi/vcard-21.txt and + * RFC2426 for more information. */ #include @@ -442,7 +442,9 @@ static void vcard_read_file( VCardFile *cardFile ) { /* g_print( "\ttype: %s\n", tagtype ); */ /* g_print( "\tvalue: %s\n", tagvalue ); */ - if( g_utf8_collate( tagtype, VCARD_TYPE_QP ) == 0 ) { + if( g_utf8_collate( tagtype, VCARD_TYPE_QP ) == 0 + || g_utf8_collate( tagtype, VCARD_TYPE_E_QP ) == 0 + || g_utf8_collate( tagtype, VCARD_TYPE_CS_UTF8_E_QP ) == 0) { gchar *tmp; /* Quoted-Printable: could span multiple lines */ tagvalue = vcard_read_qp( cardFile, tagvalue ); diff --git a/src/vcard.h b/src/vcard.h index 8c1fcc2ad..cf0274e59 100644 --- a/src/vcard.h +++ b/src/vcard.h @@ -1,6 +1,6 @@ /* - * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 2001-2012 Match Grun and the Claws Mail team + * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client + * Copyright (C) 2001-2015 Match Grun and the Claws Mail team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,13 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ /* * Definitions necessary to access vCard files. vCard files are used * by GnomeCard for addressbook, and Netscape for sending business - * card information. Refer to RFC2426 for more information. + * card information. Refer to http://www.imc.org/pdi/vcard-21.txt and + * RFC2426 for more information. */ #ifndef __VCARD_H__ @@ -45,6 +45,8 @@ #define VCARD_TAG_UID "uid" #define VCARD_TYPE_QP "quoted-printable" +#define VCARD_TYPE_E_QP "encoding=quoted-printable" +#define VCARD_TYPE_CS_UTF8_E_QP "charset=utf-8;encoding=quoted-printable" #define VCARD_SEP_TAG ':' #define VCARD_SEP_TYPE ';'