diff options
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r-- | mail/em-format-html.c | 10 |
1 files changed, 10 insertions, 0 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); } |