diff options
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/em-utils.c | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index d5ebeccf36..592c8545a4 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2006-03-06 Simon Zheng <simon.zheng@sun.com> + + Fixes bug #332140 + * em-utils.c: (em_utils_temp_save_part): + Transfer filenames from utf-8 to glib encoding before really + saving files. + 2006-03-03 Andre Klapper <a9016009@gmx.de> * configure.in, diff --git a/mail/em-utils.c b/mail/em-utils.c index cc0302fe59..13f66166ef 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1259,7 +1259,7 @@ char * em_utils_temp_save_part(GtkWidget *parent, CamelMimePart *part) { const char *filename; - char *tmpdir, *path, *mfilename = NULL; + char *tmpdir, *path, *utf8_mfilename = NULL, *mfilename = NULL; int done; tmpdir = e_mkdtemp("evolution-tmp-XXXXXX"); @@ -1273,9 +1273,11 @@ em_utils_temp_save_part(GtkWidget *parent, 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); |