From d55bf5df7ee22ad7a028d941aa1a92d757554945 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 28 Oct 2002 01:44:36 +0000 Subject: Don't set the charset param on text parts nor tha rawtext bit on the 2002-10-26 Jeffrey Stedfast * e-msg-composer-attachment-bar.c (attach_to_multipart): Don't set the charset param on text parts nor tha rawtext bit on the content if a charset for the part is already specified. svn path=/trunk/; revision=18449 --- composer/ChangeLog | 6 ++++++ composer/e-msg-composer-attachment-bar.c | 27 +++++++++++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 2caf594e13..1be4c299c7 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2002-10-26 Jeffrey Stedfast + + * e-msg-composer-attachment-bar.c (attach_to_multipart): Don't set + the charset param on text parts nor tha rawtext bit on the content + if a charset for the part is already specified. + 2002-10-25 Ettore Perazzoli * e-msg-composer-attachment-bar.c (size_to_string): Return NULL diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index d81c5cc16d..b5ddc9232b 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -754,12 +754,17 @@ attach_to_multipart (CamelMultipart *multipart, CamelStreamFilter *filtered_stream; CamelMimeFilterBestenc *bestenc; CamelStream *stream; + const char *charset; char *type; - /* Let camel know that this text part was read in raw and thus is not in - * UTF-8 format so that when it writes this part out, it doesn't try to - * convert it from UTF-8 into the @default_charset charset. */ - content->rawtext = TRUE; + /* assume that if a charset is set, that the content is in UTF-8 + * or else already has rawtext set to TRUE */ + if (!(charset = header_content_type_param (content_type, "charset"))) { + /* Let camel know that this text part was read in raw and thus is not in + * UTF-8 format so that when it writes this part out, it doesn't try to + * convert it from UTF-8 into the @default_charset charset. */ + content->rawtext = TRUE; + } stream = camel_stream_null_new (); filtered_stream = camel_stream_filter_new_with_stream (stream); @@ -777,7 +782,7 @@ attach_to_multipart (CamelMultipart *multipart, /* the text fits within us-ascii so this is safe */ /* FIXME: check that this isn't iso-2022-jp? */ default_charset = "us-ascii"; - } else { + } else if (!charset) { if (!default_charset) default_charset = mail_config_get_default_charset (); @@ -786,11 +791,13 @@ attach_to_multipart (CamelMultipart *multipart, allow the user to specify? */ } - /* looks kinda nasty, but this is how ya have to do it */ - header_content_type_set_param (content_type, "charset", default_charset); - type = header_content_type_format (content_type); - camel_mime_part_set_content_type (attachment->body, type); - g_free (type); + if (!charset) { + /* looks kinda nasty, but this is how ya have to do it */ + header_content_type_set_param (content_type, "charset", default_charset); + type = header_content_type_format (content_type); + camel_mime_part_set_content_type (attachment->body, type); + g_free (type); + } camel_object_unref (CAMEL_OBJECT (bestenc)); } else if (!CAMEL_IS_MIME_MESSAGE (content)) { -- cgit