talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 76b854fd5e98f225dcee88f17cddebe72ace6683
parent 8780b1f666b6c6ba0edbd12b597cceede8d18bde
Author: Ricardo Mones <ricardo@mones.org>
Date:   Thu,  1 Oct 2015 00:28:34 +0200

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.

Diffstat:
Msrc/vcard.c | 12+++++++-----
Msrc/vcard.h | 10++++++----
2 files changed, 13 insertions(+), 9 deletions(-)

diff --git 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 <http://www.gnu.org/licenses/>. - * */ /* * 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 <glib.h> @@ -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 @@ -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 <http://www.gnu.org/licenses/>. - * */ /* * 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 ';'