Index: addressbook/gui/widgets/e-minicard.c
===================================================================
--- addressbook/gui/widgets/e-minicard.c	(revision 34820)
+++ addressbook/gui/widgets/e-minicard.c	(working copy)
@@ -44,6 +44,9 @@
 #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);
@@ -839,7 +842,6 @@
 	GnomeCanvasGroup *group;
 	EMinicardField *minicard_field;
 	char *name;
-	char *string;
 	GList *l, *le;
 	int count =0;
 	GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL);
@@ -847,20 +849,32 @@
 
 	for (l=email_list, le=emails; l!=NULL && count < limit && le!=NULL; l = l->next, le=le->next) {
 		const gchar *tmp;
+		char *email = NULL;
+		char *string = NULL;
+		char *full_string = NULL;
+		gboolean parser_check;
 
 		tmp = get_email_location ((EVCardAttribute *) l->data);
 		if (tmp)
 			name = g_strdup_printf ("%s:", tmp);
 		else
 			name = g_strdup ("");
-		string = e_text_to_html (le->data, 0);
 
+		parser_check = parse_qp_email ((const gchar *) 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 );
@@ -882,8 +896,10 @@
 		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(name);
-		g_free(string);
+		g_free (name);
+		g_free (string);
+		g_free (full_string);
+		g_free (email);
 	}
 	g_list_foreach (emails, (GFunc) g_free, NULL);
 	g_list_free (emails);
@@ -1149,3 +1165,87 @@
 	}
 	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 (const gchar *string, gchar **name, gchar **email)
+{
+	char **values;
+	char str[4096];
+	size_t size;
+	int len;
+	char *_name = NULL, *_email = NULL;
+
+	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 = malloc (sizeof (char) * (strlen (values[0]) + 1));
+			_email = 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;
+	}
+
+	return FALSE;
+}
Index: addressbook/gui/widgets/e-minicard.h
===================================================================
--- addressbook/gui/widgets/e-minicard.h	(revision 34820)
+++ addressbook/gui/widgets/e-minicard.h	(working copy)
@@ -124,6 +124,9 @@
 				     GdkEvent  *event);
 gboolean    e_minicard_activate_editor	(EMinicard *minicard);
 
+/* To parse quoted printable address & return email & name fields */						
+gboolean parse_qp_email (const gchar *string, gchar **name, gchar **email);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: addressbook/gui/widgets/eab-contact-display.c
===================================================================
--- addressbook/gui/widgets/eab-contact-display.c	(revision 34820)
+++ addressbook/gui/widgets/eab-contact-display.c	(working copy)
@@ -37,6 +37,9 @@
 #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)
@@ -457,10 +460,27 @@
 
 	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);
+		gchar *name = NULL, *email = NULL;
+		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);
+		}
+
+		g_free (name);
+		g_free (email);
 	}
+
 	gtk_html_stream_printf (html_stream, "</td></tr></table>");
 }
 
Index: addressbook/ChangeLog
===================================================================
--- addressbook/ChangeLog	(revision 34820)
+++ addressbook/ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-01-14  Milan Crha  <mcrha@redhat.com>
+
+	** Reworked fix for bug #324604 by makuchaku (Mayank)
+
+	* gui/widgets/e-minicard.c: (add_email_field), (parse_qp_email):
+	* gui/widgets/e-minicard.h: (parse_qp_email):
+	* gui/widgets/eab-contact-display.c: (render_contact_list):
+
 2008-01-14  David Turner  <cillian64@googlemail.com>
 
 	** Partial fix for bug #498095
