[evolution/webkit: 122/182] Force UTF-8 encoding on text/html parts



commit 8d83cddb4538a13374cc256396eedec9a9de6b15
Author: Dan VrÃtil <dan progdan cz>
Date:   Wed Jan 18 22:10:29 2012 +0100

    Force UTF-8 encoding on text/html parts
    
    Must be verified though

 mail/e-mail-request.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
index 593e12d..6de8d54 100644
--- a/mail/e-mail-request.c
+++ b/mail/e-mail-request.c
@@ -269,14 +269,21 @@ mail_request_get_content_type (SoupRequest *request)
 		mime_type = g_strdup ("text/html");
 	} else if (!emr->priv->puri->mime_type) {
 		CamelContentType *ct = camel_mime_part_get_content_type (emr->priv->puri->part);
-		mime_type = camel_content_type_format (ct);
+		mime_type = camel_content_type_simple (ct);
 	} else {
 		mime_type = g_strdup (emr->priv->puri->mime_type);
 	}
 
-	d(printf("Content-Type: %s\n", mime_type));
-        emr->priv->ret_mime_type = mime_type;
-	return mime_type;
+	if (g_strcmp0 (mime_type, "text/html") == 0) {
+                emr->priv->ret_mime_type = g_strconcat (mime_type, "; charset=\"UTF-8\"", NULL);
+                g_free (mime_type);
+        } else {
+                emr->priv->ret_mime_type = mime_type;
+        }
+
+        d(printf("Content-Type: %s\n", emr->priv->ret_mime_type));
+
+        return emr->priv->ret_mime_type;
 }
 
 static const char *data_schemes[] = { "mail", "evo-file", NULL };



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]