Index: addressbook/libebook/e-vcard.c
===================================================================
--- addressbook/libebook/e-vcard.c	(revision 9772)
+++ addressbook/libebook/e-vcard.c	(working copy)
@@ -223,7 +223,7 @@ skip_until (char **p, char *s)
 }
 
 static void
-read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable)
+read_attribute_value (EVCardAttribute *attr, char **p, gboolean quoted_printable, const char *charset)
 {
 	char *lp = *p;
 	GString *str;
@@ -289,6 +289,16 @@ read_attribute_value (EVCardAttribute *a
 		}
 		else if ((*lp == ';') ||
 			 (*lp == ',' && !g_ascii_strcasecmp (attr->name, "CATEGORIES"))) {
+			if (charset) {
+				char *tmp;
+
+				tmp = g_convert (str->str, str->len, "UTF-8", charset, NULL, NULL, NULL);
+				if (tmp) {
+					g_string_assign (str, tmp);
+					g_free (tmp);
+				}
+			}
+
 			e_vcard_attribute_add_value (attr, str->str);
 			g_string_assign (str, "");
 			lp = g_utf8_next_char(lp);
@@ -299,6 +309,16 @@ read_attribute_value (EVCardAttribute *a
 		}
 	}
 	if (str) {
+		if (charset) {
+			char *tmp;
+
+			tmp = g_convert (str->str, str->len, "UTF-8", charset, NULL, NULL, NULL);
+			if (tmp) {
+				g_string_assign (str, tmp);
+				g_free (tmp);
+			}
+		}
+
 		e_vcard_attribute_add_value (attr, str->str);
 		g_string_free (str, TRUE);
 	}
@@ -309,7 +329,7 @@ read_attribute_value (EVCardAttribute *a
 }
 
 static void
-read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printable)
+read_attribute_params (EVCardAttribute *attr, char **p, gboolean *quoted_printable, char **charset)
 {
 	char *lp;
 	GString *str;
@@ -389,6 +409,13 @@ read_attribute_params (EVCardAttribute *
 					*quoted_printable = TRUE;
 					e_vcard_attribute_param_free (param);
 					param = NULL;
+				} else if (param
+				    && !g_ascii_strcasecmp (param->name, "charset")
+				    && g_ascii_strcasecmp (param->values->data, "utf-8") != 0) {
+					g_free (*charset);
+					*charset = g_strdup (param->values->data);
+					e_vcard_attribute_param_free (param);
+					param = NULL;
 				}
 			}
 			else {
@@ -468,6 +495,7 @@ read_attribute (char **p)
 	GString *str;
 	char *lp;
 	gboolean is_qp = FALSE;
+	char *charset = NULL;
 
 	/* first read in the group/name */
 	str = g_string_new ("");
@@ -533,16 +561,18 @@ read_attribute (char **p)
 	if (*lp == ';') {
 		/* skip past the ';' */
 		lp = g_utf8_next_char(lp);
-		read_attribute_params (attr, &lp, &is_qp);
+		read_attribute_params (attr, &lp, &is_qp, &charset);
 		if (is_qp)
 			attr->encoding = EVC_ENCODING_RAW;
 	}
 	if (*lp == ':') {
 		/* skip past the ':' */
 		lp = g_utf8_next_char(lp);
-		read_attribute_value (attr, &lp, is_qp);
+		read_attribute_value (attr, &lp, is_qp, charset);
 	}
 
+	g_free (charset);
+
 	*p = lp;
 
 	if (!attr->values)
Index: addressbook/ChangeLog
===================================================================
--- addressbook/ChangeLog	(revision 9772)
+++ addressbook/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-11-19  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #560681
+
+	* libebook/e-vcard.c: (read_attribute_value), (read_attribute_params),
+	(read_attribute): Support CHARSET parameter within the attribute and
+	convert text to UTF-8, if necessary, based on its value.
+
 2008-11-07  Sankar P  <psankar@novell.com>
 
 	** Patch committed on behalf of Ashish Shrivastava <shashish@novell.com>
