aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-07-17 04:45:56 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-07-17 04:45:56 +0800
commit1dea5ca33880b87d3d0be94867755aa69707a627 (patch)
treec686decae5f0d06c2d906563d9f74d92d0c6fa3c /composer/e-msg-composer.c
parentb83ddf044ce11b4c52996f7827d843465ad5659b (diff)
downloadgsoc2013-evolution-1dea5ca33880b87d3d0be94867755aa69707a627.tar
gsoc2013-evolution-1dea5ca33880b87d3d0be94867755aa69707a627.tar.gz
gsoc2013-evolution-1dea5ca33880b87d3d0be94867755aa69707a627.tar.bz2
gsoc2013-evolution-1dea5ca33880b87d3d0be94867755aa69707a627.tar.lz
gsoc2013-evolution-1dea5ca33880b87d3d0be94867755aa69707a627.tar.xz
gsoc2013-evolution-1dea5ca33880b87d3d0be94867755aa69707a627.tar.zst
gsoc2013-evolution-1dea5ca33880b87d3d0be94867755aa69707a627.zip
don't set the rawtext bit anymore.
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-16 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-attachment-bar.c (popup_menu_event): Fix warnings and other breakage introduced by Maxx. svn path=/trunk/; revision=21843
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 32b39b88d0..f1e634b809 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1,7 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* e-msg-composer.c
*
- * Copyright (C) 1999 Ximian, Inc.
+ * Copyright (C) 1999-2003 Ximian, Inc. (www.ximian.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -80,9 +80,10 @@
#include "e-util/e-dialog-utils.h"
#include "widgets/misc/e-charset-picker.h"
-#include "camel/camel.h"
-#include "camel/camel-charset-map.h"
-#include "camel/camel-session.h"
+#include <camel/camel-session.h>
+#include <camel/camel-charset-map.h>
+#include <camel/camel-stream-filter.h>
+#include <camel/camel-mime-filter-charset.h>
#include "mail/mail-callbacks.h"
#include "mail/mail-crypto.h"
@@ -345,16 +346,16 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
EMsgComposerAttachmentBar *attachment_bar =
E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar);
EMsgComposerHdrs *hdrs = E_MSG_COMPOSER_HDRS (composer->hdrs);
- CamelMimeMessage *new;
- GByteArray *data;
CamelDataWrapper *plain, *html, *current;
CamelMimePartEncodingType plain_encoding;
- const char *charset;
+ CamelMultipart *body = NULL;
CamelContentType *type;
+ CamelMimeMessage *new;
+ const char *charset;
CamelStream *stream;
- CamelMultipart *body = NULL;
CamelMimePart *part;
CamelException ex;
+ GByteArray *data;
int i;
if (composer->persist_stream_interface == CORBA_OBJECT_NIL)
@@ -402,11 +403,26 @@ build_message (EMsgComposer *composer, gboolean save_html_object_data)
}
plain = camel_data_wrapper_new ();
- plain->rawtext = FALSE;
- 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;
+
+ stream = camel_stream_mem_new_with_byte_array (data);
+ 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 */
camel_data_wrapper_construct_from_stream (plain, stream);
camel_object_unref (stream);
+
camel_data_wrapper_set_mime_type_field (plain, type);
header_content_type_unref (type);
@@ -432,7 +448,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);