diff options
author | Simon Zheng <simon.zheng@sun.com> | 2006-03-06 18:44:25 +0800 |
---|---|---|
committer | Simon Zheng <simonz@src.gnome.org> | 2006-03-06 18:44:25 +0800 |
commit | 1ad03dc11b01ce3df30fd141e50daed454c4967e (patch) | |
tree | 20795fc92783d05705ffeafe192dc2d51bb862f7 | |
parent | fad1b8ef5e21e42caf1d689452ec19a1cd77d999 (diff) | |
download | gsoc2013-evolution-1ad03dc11b01ce3df30fd141e50daed454c4967e.tar.gz gsoc2013-evolution-1ad03dc11b01ce3df30fd141e50daed454c4967e.tar.zst gsoc2013-evolution-1ad03dc11b01ce3df30fd141e50daed454c4967e.zip |
Fixes bug #332140 Transfer filenames from utf-8 to glib encoding before
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.
svn path=/trunk/; revision=31662
-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); |