aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-10-13 22:28:43 +0800
committerMilan Crha <mcrha@redhat.com>2010-10-13 22:28:43 +0800
commit26b7d1f342e19ed828c4d3a3b99b15987fddeb94 (patch)
tree1b9543a84db93fa8fb06ba919139bc616c29f2c8 /mail
parentc83faa7078cc1fd280ac573b07645e8464b2fdc4 (diff)
downloadgsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.gz
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.bz2
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.lz
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.xz
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.zst
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.zip
Bug #630375 - Character encoding of GPG encrypted message not honored
Diffstat (limited to 'mail')
-rw-r--r--mail/em-format-html.c10
-rw-r--r--mail/em-inline-filter.c6
2 files changed, 14 insertions, 2 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 42edac30d4..2e9bad7273 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1738,6 +1738,7 @@ efh_text_plain (EMFormat *emf,
EMInlineFilter *inline_filter;
CamelStream *null;
CamelContentType *ct;
+ gboolean charset_added = FALSE;
/* if we had to snoop the part type to get here, then
* use that as the base type, yuck */
@@ -1747,6 +1748,11 @@ efh_text_plain (EMFormat *emf,
camel_content_type_ref (ct);
}
+ if (dw->mime_type && ct != dw->mime_type && camel_content_type_param (dw->mime_type, "charset")) {
+ camel_content_type_set_param (ct, "charset", camel_content_type_param (dw->mime_type, "charset"));
+ charset_added = TRUE;
+ }
+
null = camel_stream_null_new ();
filtered_stream = camel_stream_filter_new (null);
g_object_unref (null);
@@ -1764,6 +1770,10 @@ efh_text_plain (EMFormat *emf,
efhc = efh_insert_cache (efh, emf->part_id->str);
efhc->textmp = mp;
+ if (charset_added) {
+ camel_content_type_set_param (ct, "charset", NULL);
+ }
+
g_object_unref (inline_filter);
camel_content_type_unref (ct);
}
diff --git a/mail/em-inline-filter.c b/mail/em-inline-filter.c
index 7aeb36c291..7222c03489 100644
--- a/mail/em-inline-filter.c
+++ b/mail/em-inline-filter.c
@@ -102,8 +102,10 @@ inline_filter_add_part (EMInlineFilter *emif, const gchar *data, gint len)
g_object_unref (mem);
if (emif_types[emif->state].plain && emif->base_type) {
- camel_content_type_ref (emif->base_type);
- content_type = emif->base_type;
+ /* create a copy */
+ type = camel_content_type_format (emif->base_type);
+ content_type = camel_content_type_decode (type);
+ g_free (type);
} else {
/* we want to preserve all params */
type = camel_content_type_format (emif->base_type);