From 1ff721e815ebf323d376b0b0dd50ecb9c9407f8f Mon Sep 17 00:00:00 2001 From: Simon Zheng Date: Mon, 6 Mar 2006 10:47:01 +0000 Subject: Fixes bug #332140 Changed to transfer filenames from utf-8 to glib 2006-03-06 Simon Zheng Fixes bug #332140 * e-attachment-bar.c: (temp_save_part): Changed to transfer filenames from utf-8 to glib encoding before really saving files. svn path=/trunk/; revision=31664 --- widgets/misc/e-attachment-bar.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'widgets/misc/e-attachment-bar.c') diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c index 824e110746..7bf8de6844 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/widgets/misc/e-attachment-bar.c @@ -671,7 +671,7 @@ static char * temp_save_part(CamelMimePart *part) { const char *filename; - char *tmpdir, *path, *mfilename = NULL; + char *tmpdir, *path, *mfilename = NULL, *utf8_mfilename = NULL; CamelStream *stream; CamelDataWrapper *wrapper; @@ -685,9 +685,11 @@ temp_save_part(CamelMimePart *part) /* This is the default filename used for temporary file creation */ filename = _("Unknown"); } else { - mfilename = g_strdup(filename); - e_filename_make_safe(mfilename); - filename = mfilename; + utf8_mfilename = g_strdup (filename); + e_filename_make_safe (utf8_mfilename); + mfilename = g_filename_from_utf8 ((const char *) utf8_mfilename, -1, NULL, NULL, NULL); + g_free (utf8_mfilename); + filename = (const char *) mfilename; } path = g_build_filename(tmpdir, filename, NULL); -- cgit v1.2.3