Index: ./addressbook/gui/widgets/eab-contact-display.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/eab-contact-display.c,v
retrieving revision 1.31
diff -u -8 -p -r1.31 eab-contact-display.c
--- ./addressbook/gui/widgets/eab-contact-display.c	24 Jul 2006 13:06:19 -0000	1.31
+++ ./addressbook/gui/widgets/eab-contact-display.c	9 Oct 2006 06:31:32 -0000
@@ -32,16 +32,20 @@
 #include "e-util/e-icon-factory.h"
 
 #include <string.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-url.h>
 #include <gtkhtml/gtkhtml.h>
 #include <gtkhtml/gtkhtml-stream.h>
 
+/* for decoding quoted printable addresses */
+#include "e-minicard.h"
+
+
 #define HANDLE_MAILTO_INTERNALLY 1
 
 #define PARENT_TYPE (GTK_TYPE_HTML)
 
 struct _EABContactDisplayPrivate {
 	EContact *contact;
 
         GtkWidget *invisible;
@@ -71,16 +75,17 @@ common_location [] =
 #define JABBER_ICON       "im-jabber"
 #define MSN_ICON          "im-msn"
 #define YAHOO_ICON        "im-yahoo"
 #define GADUGADU_ICON	    "im-gadugadu"
 #define VIDEOCONF_ICON    "stock_video-conferencing"
 
 #define MAX_COMPACT_IMAGE_DIMENSION 48
 
+
 static void
 eab_uri_popup_link_open(EPopup *ep, EPopupItem *item, void *data)
 {
 	EABPopupTargetURI *t = (EABPopupTargetURI *)ep->target;
 	GError *err = NULL;
 		
 	gnome_url_show(t->uri, &err);
 	if (err) {
@@ -445,35 +450,55 @@ accum_multival_attribute (GString *gstr,
 	for (l = val_list; l; l = l->next) {
 		const char *str = (const char *) l->data;
 		accum_name_value (gstr, html_label, str, icon, html_flags);
 	}
 	g_list_foreach (val_list, (GFunc) g_free, NULL);
 	g_list_free (val_list);
 }
 
+
 static void
 render_contact_list (GtkHTMLStream *html_stream, EContact *contact)
 {
 	GList *email_list;
 	GList *l;
+	gchar *name, *email;
 
 	gtk_html_stream_printf (html_stream, "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>");
 	gtk_html_stream_printf (html_stream, "<td valign=\"top\" width=\"" IMAGE_COL_WIDTH "\">");
 	gtk_html_stream_printf (html_stream, "<img width=\"16\" height=\"16\" src=\"evo-icon:" CONTACT_LIST_ICON "\">");
 	gtk_html_stream_printf (html_stream, "</td><td valign=\"top\" width=\"100\" nowrap><font color=" HEADER_COLOR ">%s:</font></td> <td valign=\"top\">", _("List Members"));
 
+	
 	email_list = e_contact_get (contact, E_CONTACT_EMAIL);
+	
 	for (l = email_list; l; l = l->next) {
-		char *html = e_text_to_html (l->data, E_TEXT_TO_HTML_CONVERT_ADDRESSES);
-		gtk_html_stream_printf (html_stream, "%s<br>", html);
-		g_free (html);
+		char *html_name, *html_email;
+		if(parse_qp_email(l->data, &name, &email))
+		{
+			/* we got a quoted printable string */
+			html_name = e_text_to_html (name, E_TEXT_TO_HTML_CONVERT_ADDRESSES);
+			html_email = e_text_to_html (email, E_TEXT_TO_HTML_CONVERT_ADDRESSES);
+			gtk_html_stream_printf (html_stream, "%s &lt;%s&gt;<br>", html_name, html_email);
+			g_free (html_name);
+			g_free (html_email);
+		}
+		else
+		{
+			/* we got a normal contact string */
+			html_name = e_text_to_html (l->data, E_TEXT_TO_HTML_CONVERT_ADDRESSES);
+			gtk_html_stream_printf (html_stream, "%s<br>", html_name);
+			g_free(html_name);
+		}
+		
 	}
 	gtk_html_stream_printf (html_stream, "</td></tr></table>");
 }
+
 
 static void
 start_block (GtkHTMLStream *html_stream, const char *label)
 {
 	gtk_html_stream_printf (html_stream, "<tr><td height=\"20\" colspan=\"3\"><font color=" HEADER_COLOR "><b>%s</b></font></td></tr>", label);
 }
 
 static void
Index: ./addressbook/gui/widgets/e-minicard.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/e-minicard.c,v
retrieving revision 1.129
diff -u -8 -p -r1.129 e-minicard.c
--- ./addressbook/gui/widgets/e-minicard.c	19 Jul 2006 10:40:42 -0000	1.129
+++ ./addressbook/gui/widgets/e-minicard.c	9 Oct 2006 06:31:33 -0000
@@ -38,16 +38,19 @@
 #include "e-minicard.h"
 #include "e-minicard-label.h"
 #include "e-minicard-view.h"
 #include "e-contact-editor.h"
 #include <e-util/e-icon-factory.h>
 #include <libebook/e-destination.h>
 #include "a11y/addressbook/ea-addressbook.h"
 
+/* for decoding quoted printable email addresses */
+#include <libical/ical.h>
+
 static void e_minicard_init		(EMinicard		 *card);
 static void e_minicard_class_init	(EMinicardClass	 *klass);
 static void e_minicard_set_property  (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
 static void e_minicard_get_property  (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
 static void e_minicard_dispose (GObject *object);
 static void e_minicard_finalize (GObject *object);
 static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
 static void e_minicard_realize (GnomeCanvasItem *item);
@@ -801,23 +804,24 @@ add_field (EMinicard *e_minicard, EConta
 #ifdef notyet
 	g_object_set(E_MINICARD_LABEL(new_item)->field,
 		     "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->contact, field),
 		     NULL);
 #endif
 	g_object_set_data(G_OBJECT (E_MINICARD_LABEL(new_item)->field),
 			  "EMinicard:field",
 			  GINT_TO_POINTER(field));
-
+	
 	minicard_field = g_new(EMinicardField, 1);
 	minicard_field->field = field;
 	minicard_field->label = new_item;
 
 	e_minicard->fields = g_list_append( e_minicard->fields, minicard_field);
 	e_canvas_item_move_absolute(new_item, 2, e_minicard->height);
+	
 	g_free(name);
 	g_free(string);
 }
 
 
 static const char *
 get_email_location (EVCardAttribute *attr)
 {
@@ -832,34 +836,48 @@ get_email_location (EVCardAttribute *att
 }
 
 static void
 add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, int limit)
 {
 	GnomeCanvasItem *new_item;
 	GnomeCanvasGroup *group;
 	EMinicardField *minicard_field;
-	char *name;
-	char *string;
+	char *name = NULL;
+	char *email = NULL;
+	char *string = NULL;
+	char *full_string = NULL;
 	GList *l, *le;
 	int count =0;
+	gboolean parser_check;
 	GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL);
 	group = GNOME_CANVAS_GROUP( e_minicard );
 
 	for (l=email_list, le=emails; l!=NULL && count < limit && le!=NULL; l = l->next, le=le->next) {
 		
 		name = get_email_location ((EVCardAttribute *) l->data);
-		string = e_text_to_html (le->data, 0);
+		
+		parser_check = parse_qp_email((EVCardAttribute *) le->data, &string, &email);
+		if(parser_check)
+		{
+			/* if true, we had a quoted printable mail address */
+			full_string = g_strdup_printf("%s <%s>", string, email);
+		}
+		else
+		{
+			/* we got a NON-quoted printable string */
+			string = g_strdup(le->data);
+		}		
 
 		new_item = e_minicard_label_new(group);
 	
 		gnome_canvas_item_set( new_item,
 				       "width", e_minicard->width - 4.0,
 				       "fieldname", name,
-				       "field", string,
+				       "field", parser_check?full_string:string,
 				       "max_field_name_length", left_width,
 				       "editable", FALSE /* e_minicard->editable */,
 				       NULL );
 
 
 #ifdef notyet
 		g_object_set(E_MINICARD_LABEL(new_item)->field,
 			     "allow_newlines", e_card_simple_get_allow_newlines (e_minicard->contact, field),
@@ -871,17 +889,19 @@ add_email_field (EMinicard *e_minicard, 
 
 		minicard_field = g_new(EMinicardField, 1);
 		minicard_field->field = E_CONTACT_EMAIL;
 		minicard_field->label = new_item;
 
 		e_minicard->fields = g_list_append( e_minicard->fields, minicard_field);
 		e_canvas_item_move_absolute(new_item, 2, e_minicard->height);
 		count++;
-		g_free(string);
+
+		if(email)
+			g_free(email);
 	}
 	g_list_free (emails);
 }
 
 static int
 get_left_width(EMinicard *e_minicard)
 {
 	gchar *name;
@@ -1131,9 +1151,97 @@ e_minicard_drag_begin (EMinicard *minica
 		       e_minicard_signals[DRAG_BEGIN], 0,
 		       event, &ret_val);
 
 	parent = GNOME_CANVAS_ITEM (minicard)->parent;
 	if (parent && E_IS_REFLOW (parent)) {
 		E_REFLOW (parent)->maybe_in_drag = FALSE;
 	}
 	return ret_val;
+}
+
+
+/* To parse something like...
+=?UTF-8?Q?=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=?UTF-8?Q?=E0=A4=B0?=\t\n<aa@aa.ccom>
+and return the decoded representation of name & email parts.
+*/
+gboolean parse_qp_email (gchar *string, gchar **name, gchar **email)
+{
+	char **values;
+	char str[4096];
+	int size;
+	int len;
+	char *_name, *_email;
+	int i;
+		
+	if(g_strstr_len(string, strlen(string), "=?UTF-8?Q?"))
+	{
+		/* split string on "=?UTF-8?Q?" */
+		values = g_strsplit(string, "=?UTF-8?Q?", -1);
+		len = g_strv_length(values);
+		if(len > 1)
+		{
+			char *long_qp_string;
+			char *temp = NULL;
+			
+			/* okay, we need to join & parse the string now! */
+			long_qp_string = g_strjoinv("", values);
+			
+			/*
+			Now we have something like
+			=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87?=\t\n=E0=A4=B0?=\t\n<aa@aa.ccom>
+			*/
+			
+			/* now remove "?=\n\t" from the long string */
+			values = g_strsplit(long_qp_string, "?=\n\t", -1);
+			len = g_strv_length(values);
+			
+			if(len > 1)
+				long_qp_string = g_strjoinv("", values);
+				
+			/* replacing any "_" found in the QP string with space " ", generally seen in indic names */
+			values = g_strsplit(long_qp_string, "_", -1);
+			len = g_strv_length(values);
+			
+			if(len > 1)
+				long_qp_string = g_strjoinv(" ", values);	
+			
+			/*
+			Now we have something like
+			=E0=A4=95=E0=A4=95=E0=A4=AC=E0=A5=82=E0=A5=8B=E0=A5=87=E0=A4=B0<aa@aa.ccom>
+			*/			
+			
+			/* fetching name/email from this long quoted printable string! */
+			values = g_strsplit_set(long_qp_string, "<>", -1);
+
+			_name = (char *)malloc((sizeof(char) * strlen(values[0])) + 1);
+			_email = (char *)malloc((sizeof(char) * strlen(values[1])) + 1);
+			
+			len = strlen(values[1]);
+			strncpy(_email, values[1], len+1);
+			*email = _email;
+			
+			len = strlen(values[0]);
+			strncpy(_name, values[0], len+1);
+			
+			g_strfreev(values);
+			
+			/* Before conversion from QP, just check & remove "?=" from the name part (if needed) */
+			if(g_strstr_len(string, strlen(_name), "?="))
+			{
+				values = g_strsplit(_name, "?=", -1);
+				len = g_strv_length(values);
+				if(len > 1)
+					temp = g_strjoinv("", values);
+			}
+				
+			decode_quoted_printable(str, temp?temp:_name, &size);
+			str[size] = '\0';
+			*name = str;
+			
+			g_strfreev(values);
+		}
+		
+		return TRUE;
+	}
+	else
+		return FALSE;
 }
Index: ./addressbook/gui/widgets/e-minicard.h
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/e-minicard.h,v
retrieving revision 1.35
diff -u -8 -p -r1.35 e-minicard.h
--- ./addressbook/gui/widgets/e-minicard.h	8 Nov 2004 06:12:11 -0000	1.35
+++ ./addressbook/gui/widgets/e-minicard.h	9 Oct 2006 06:31:33 -0000
@@ -119,14 +119,17 @@ GType       e_minicard_get_type     (voi
 const char *e_minicard_get_card_id  (EMinicard *minicard);
 int         e_minicard_compare      (EMinicard *minicard1,
 				     EMinicard *minicard2);
 
 int         e_minicard_selected     (EMinicard *minicard,
 				     GdkEvent  *event);
 gboolean    e_minicard_activate_editor	(EMinicard *minicard);
 
+/* To parse quoted printable address & return email & name fields */						
+gboolean parse_qp_email (gchar *string, gchar **name, gchar **email);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
 
 
 #endif /* __E_MINICARD_H__ */
