diff options
author | Simon Zheng <simon.zheng@sun.com> | 2006-03-06 18:45:57 +0800 |
---|---|---|
committer | Simon Zheng <simonz@src.gnome.org> | 2006-03-06 18:45:57 +0800 |
commit | 4ec70528ea81baa081b4ce41e25624958b14fc4b (patch) | |
tree | 778af9d9ff960d25d3d3818f4dc932b0db4273f5 /calendar/gui | |
parent | 1ad03dc11b01ce3df30fd141e50daed454c4967e (diff) | |
download | gsoc2013-evolution-4ec70528ea81baa081b4ce41e25624958b14fc4b.tar gsoc2013-evolution-4ec70528ea81baa081b4ce41e25624958b14fc4b.tar.gz gsoc2013-evolution-4ec70528ea81baa081b4ce41e25624958b14fc4b.tar.bz2 gsoc2013-evolution-4ec70528ea81baa081b4ce41e25624958b14fc4b.tar.lz gsoc2013-evolution-4ec70528ea81baa081b4ce41e25624958b14fc4b.tar.xz gsoc2013-evolution-4ec70528ea81baa081b4ce41e25624958b14fc4b.tar.zst gsoc2013-evolution-4ec70528ea81baa081b4ce41e25624958b14fc4b.zip |
Fixes bug #332140
2006-03-06 Simon Zheng <simon.zheng@sun.com>
Fixes bug #332140
* gui/dialogs/comp-editor.c: (get_attachment_list):
* gui/e-cal-popup.c: (temp_save_part):
Transfer filenames from utf-8 to glib encoding before really
saving files.
svn path=/trunk/; revision=31663
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 6 | ||||
-rw-r--r-- | calendar/gui/e-cal-popup.c | 18 |
2 files changed, 15 insertions, 9 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index cc19b006f8..f6fa0e9730 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -634,7 +634,7 @@ get_attachment_list (CompEditor *editor) CamelDataWrapper *wrapper; CamelStream *stream; char *attach_file_url; - char *safe_fname; + char *safe_fname, *utf8_safe_fname; char *filename; wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (p->data)); @@ -642,7 +642,9 @@ get_attachment_list (CompEditor *editor) /* Extract the content from the stream and write it down * as a mime part file into the directory denoting the * calendar source */ - safe_fname = camel_file_util_safe_filename(camel_mime_part_get_filename ((CamelMimePart *)p->data)); + utf8_safe_fname = camel_file_util_safe_filename (camel_mime_part_get_filename ((CamelMimePart *) p->data)); + safe_fname = g_filename_from_utf8 ((const char *) utf8_safe_fname, -1, NULL, NULL, NULL); + g_free (utf8_safe_fname); filename = g_strdup_printf ("%s-%s", comp_uid, safe_fname); diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index c4cc57ee9c..7e1d1ca040 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -91,7 +91,7 @@ static char * temp_save_part(CamelMimePart *part, char *path, gboolean file) { const char *filename; - char *tmpdir, *mfilename = NULL; + char *tmpdir, *utf8_mfilename = NULL, *mfilename = NULL; CamelStream *stream; CamelDataWrapper *wrapper; @@ -106,9 +106,11 @@ temp_save_part(CamelMimePart *part, char *path, gboolean file) /* 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); @@ -121,9 +123,11 @@ temp_save_part(CamelMimePart *part, char *path, gboolean file) /* 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); |