From 2ed79f33bb7e8e425c0d64e4349bcb650e5fa13d Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 6 Jul 2001 22:00:06 +0000 Subject: Convert the filename string to UTF8 before setting it on the CamelMimePart 2001-07-06 Jeffrey Stedfast * 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 --- composer/ChangeLog | 6 ++++++ composer/e-msg-composer-attachment.c | 10 +++++++--- composer/e-msg-composer.c | 25 ++++++++++++------------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 193d2c5bf5..0dfa3b3790 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2001-07-06 Jeffrey Stedfast + + * 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. + 2001-07-06 Larry Ewing * e-msg-composer.c (autosave_manager_query_load_orphans): only ask 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 (); diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 0c49e8ff35..0506ac75e9 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -709,12 +709,12 @@ static void prepare_engine (EMsgComposer *composer) { CORBA_Environment ev; - + g_assert (composer); g_assert (E_IS_MSG_COMPOSER (composer)); - + /* printf ("prepare_engine\n"); */ - + CORBA_exception_init (&ev); composer->editor_engine = (GNOME_GtkHTML_Editor_Engine) bonobo_object_client_query_interface (bonobo_widget_get_server (BONOBO_WIDGET (composer->editor)), "IDL:GNOME/GtkHTML/Editor/Engine:1.0", &ev); @@ -740,10 +740,10 @@ get_signature_html (EMsgComposer *composer) { gboolean format_html = FALSE; gchar *text, *html = NULL, *sig_file = NULL; - + if (E_MSG_COMPOSER_HDRS (composer->hdrs)->account->id) { MailConfigIdentity *id; - + id = E_MSG_COMPOSER_HDRS (composer->hdrs)->account->id; if (composer->send_html) { if (id->has_html_signature) { @@ -754,10 +754,10 @@ get_signature_html (EMsgComposer *composer) } else sig_file = id->signature; } - + if (!sig_file) return NULL; - + text = e_msg_composer_get_sig_file_content (sig_file, format_html); if (text) { html = g_strdup_printf ("" @@ -771,7 +771,7 @@ get_signature_html (EMsgComposer *composer) g_free (text); text = html; } - + return text; } @@ -782,7 +782,7 @@ set_editor_text (EMsgComposer *composer, const char *text) BonoboStream *stream; BonoboWidget *editor; CORBA_Environment ev; - + editor = BONOBO_WIDGET (composer->editor); CORBA_exception_init (&ev); @@ -998,7 +998,7 @@ save_draft (EMsgComposer *composer, int quitok) folder = drafts_folder; msg = e_msg_composer_get_message_draft (composer); - + info = g_new0 (CamelMessageInfo, 1); info->flags = CAMEL_MESSAGE_DRAFT | CAMEL_MESSAGE_SEEN; @@ -2219,7 +2219,8 @@ e_msg_composer_construct (EMsgComposer *composer) gtk_window_set_default_size (GTK_WINDOW (composer), DEFAULT_WIDTH, DEFAULT_HEIGHT); - gnome_window_icon_set_from_file (GTK_WINDOW (composer), EVOLUTION_DATADIR "/images/evolution/compose-message.png"); + gnome_window_icon_set_from_file (GTK_WINDOW (composer), EVOLUTION_DATADIR + "/images/evolution/compose-message.png"); bonobo_window_construct (BONOBO_WINDOW (composer), "e-msg-composer", _("Compose a message")); @@ -2360,8 +2361,6 @@ e_msg_composer_new_with_sig_file () e_msg_composer_set_send_html (new, mail_config_get_send_html ()); set_editor_text (new, ""); } - - /* printf ("e_msg_composer_new_with_sig_file %p\n", new); */ return new; } -- cgit