aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-attachment-bar.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-03 05:13:18 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-03 05:13:18 +0800
commite694ee7fffe74825f0791748a11e13e5e6585804 (patch)
tree3eb18ffaeadf365dc44706c16472532c2d4907d1 /composer/e-msg-composer-attachment-bar.c
parenta344e38cdbb5991963fb340b1f249da53d069fe6 (diff)
downloadgsoc2013-evolution-e694ee7fffe74825f0791748a11e13e5e6585804.tar.gz
gsoc2013-evolution-e694ee7fffe74825f0791748a11e13e5e6585804.tar.zst
gsoc2013-evolution-e694ee7fffe74825f0791748a11e13e5e6585804.zip
Set the user-chosen charset.
2001-07-02 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-attachment-bar.c (attach_to_multipart): Set the user-chosen charset. * e-msg-composer.c (menu_change_charset_cb): New callback function to get the user-set charset. (init): Set the charset to NULL. (best_charset): Take a default_charset param that holds the value the user set for this particular message using the menu. (destroy): Free the charset. svn path=/trunk/; revision=10704
Diffstat (limited to 'composer/e-msg-composer-attachment-bar.c')
-rw-r--r--composer/e-msg-composer-attachment-bar.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c
index 27d017e787..3e454cd8b8 100644
--- a/composer/e-msg-composer-attachment-bar.c
+++ b/composer/e-msg-composer-attachment-bar.c
@@ -729,7 +729,8 @@ best_encoding (const guchar *text)
static void
attach_to_multipart (CamelMultipart *multipart,
- EMsgComposerAttachment *attachment)
+ EMsgComposerAttachment *attachment,
+ const char *default_charset)
{
CamelContentType *content_type;
@@ -747,9 +748,10 @@ attach_to_multipart (CamelMultipart *multipart,
g_byte_array_append (array, "", 1);
text = array->data;
- if (is_8bit (text))
+ if (is_8bit (text)) {
camel_mime_part_set_encoding (attachment->body, best_encoding (text));
- else
+ header_content_type_set_param (content_type, "charset", default_charset);
+ } else
camel_mime_part_set_encoding (attachment->body, CAMEL_MIME_PART_ENCODING_7BIT);
camel_object_unref (CAMEL_OBJECT (stream));
@@ -764,7 +766,8 @@ attach_to_multipart (CamelMultipart *multipart,
void
e_msg_composer_attachment_bar_to_multipart (EMsgComposerAttachmentBar *bar,
- CamelMultipart *multipart)
+ CamelMultipart *multipart,
+ const char *default_charset)
{
EMsgComposerAttachmentBarPrivate *priv;
GList *p;
@@ -780,7 +783,7 @@ e_msg_composer_attachment_bar_to_multipart (EMsgComposerAttachmentBar *bar,
EMsgComposerAttachment *attachment;
attachment = E_MSG_COMPOSER_ATTACHMENT (p->data);
- attach_to_multipart (multipart, attachment);
+ attach_to_multipart (multipart, attachment, default_charset);
}
}