aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer-attachment.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-07 06:00:06 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-07 06:00:06 +0800
commit2ed79f33bb7e8e425c0d64e4349bcb650e5fa13d (patch)
treeba0ac30dc4530521ff963929ef4934b8af4f7547 /composer/e-msg-composer-attachment.c
parentb663fac4aba204cd2bfe9e2d23c3cc40d9855978 (diff)
downloadgsoc2013-evolution-2ed79f33bb7e8e425c0d64e4349bcb650e5fa13d.tar.gz
gsoc2013-evolution-2ed79f33bb7e8e425c0d64e4349bcb650e5fa13d.tar.zst
gsoc2013-evolution-2ed79f33bb7e8e425c0d64e4349bcb650e5fa13d.zip
Convert the filename string to UTF8 before setting it on the CamelMimePart
2001-07-06 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer-attachment.c (e_msg_composer_attachment_new): Convert the filename string to UTF8 before setting it on the CamelMimePart because that code expects it to be in UTF8. svn path=/trunk/; revision=10869
Diffstat (limited to 'composer/e-msg-composer-attachment.c')
-rw-r--r--composer/e-msg-composer-attachment.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/composer/e-msg-composer-attachment.c b/composer/e-msg-composer-attachment.c
index f0cfa63750..1c03b0ff35 100644
--- a/composer/e-msg-composer-attachment.c
+++ b/composer/e-msg-composer-attachment.c
@@ -157,6 +157,7 @@ e_msg_composer_attachment_new (const gchar *file_name,
struct stat statbuf;
gchar *mime_type;
char *content_id;
+ char *filename;
g_return_val_if_fail (file_name != NULL, NULL);
@@ -183,12 +184,15 @@ e_msg_composer_attachment_new (const gchar *file_name,
part = camel_mime_part_new ();
camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper);
camel_object_unref (CAMEL_OBJECT (wrapper));
-
+
camel_mime_part_set_disposition (part, disposition);
if (strchr (file_name, '/'))
- camel_mime_part_set_filename (part, strrchr (file_name, '/') + 1);
+ filename = e_utf8_from_locale_string (strrchr (file_name, '/') + 1);
else
- camel_mime_part_set_filename (part, file_name);
+ filename = e_utf8_from_locale_string (file_name);
+
+ camel_mime_part_set_filename (part, filename);
+ g_free (filename);
/* set the Content-Id */
content_id = header_msgid_generate ();