aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog8
-rw-r--r--composer/e-msg-composer-attachment-bar.c9
-rw-r--r--composer/e-msg-composer.c31
3 files changed, 30 insertions, 18 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 8c9cc42df4..425bcfe462 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,11 @@
+2003-07-16 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-msg-composer-attachment-bar.c (attach_to_multipart): don't set
+ the rawtext bit anymore.
+
+ * e-msg-composer.c (build_message): Convert the plain part's
+ content stream from UTF-8 to whatever charset we want.
+
2003-07-31 Antonio Xu <antonio.xu@sun.com>
* e-msg-composer.c (drag_data_received): add the drop type of
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c
index c6e9e7bcee..4cc893ec1a 100644
--- a/composer/e-msg-composer-attachment-bar.c
+++ b/composer/e-msg-composer-attachment-bar.c
@@ -753,14 +753,7 @@ attach_to_multipart (CamelMultipart *multipart,
const char *charset;
char *type;
- /* 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;
- }
+ charset = header_content_type_param (content_type, "charset");
stream = camel_stream_null_new ();
filter_stream = camel_stream_filter_new_with_stream (stream);
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index ce29cf35f1..a7021fcba5 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -406,10 +406,22 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
stream = camel_stream_mem_new_with_byte_array (data);
+ /* convert the stream to the appropriate charset */
+ if (charset && strcasecmp (charset, "UTF-8") != 0) {
+ CamelStreamFilter *filter_stream;
+ CamelMimeFilterCharset *filter;
+
+ filter_stream = camel_stream_filter_new_with_stream (stream);
+ camel_object_unref (stream);
+
+ stream = (CamelStream *) filter_stream;
+ filter = camel_mime_filter_charset_new_convert ("UTF-8", charset);
+ camel_stream_filter_add (filter_stream, (CamelMimeFilter *) filter);
+ camel_object_unref (filter);
+ }
+
/* construct the content object */
plain = camel_data_wrapper_new ();
- plain->rawtext = FALSE;
-
camel_data_wrapper_construct_from_stream (plain, stream);
camel_object_unref (stream);
@@ -438,7 +450,6 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
}
html = camel_data_wrapper_new ();
- html->rawtext = FALSE;
stream = camel_stream_mem_new_with_byte_array (data);
camel_data_wrapper_construct_from_stream (html, stream);
@@ -1398,14 +1409,14 @@ autosave_manager_query_load_orphans (AutosaveManager *am, GtkWindow *parent)
if (match != NULL) {
GtkWidget *dialog;
- dialog = gtk_message_dialog_new(parent,
- GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
- _("Ximian Evolution has found unsaved files from a previous session.\n"
- "Would you like to try to recover them?"));
+ dialog = gtk_message_dialog_new (parent,
+ GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
+ _("Ximian Evolution has found unsaved files from a previous session.\n"
+ "Would you like to try to recover them?"));
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
- load = gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES;
- gtk_widget_destroy(dialog);
+ load = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES;
+ gtk_widget_destroy (dialog);
}
while (match != NULL) {