From 2d4572fedc54a05f6f01bb9f161c13d30ab1afbe Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 3 Apr 2011 01:15:02 +0200 Subject: [PATCH] In filesel_create(), do not run the filename through g_filename_from_utf8() gtk_file_chooser_set_current_name() actually expects utf8-encoded input and may choke on the encoding used for filenames. Previously umlauts in attachment filenames weren't rendered properly in the "Save as ..." window and could cause crashes when tab completing the filename after certain modifications. --- src/gtk/filesel.c | 11 ++--------- 1 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/gtk/filesel.c b/src/gtk/filesel.c index fb28de1..439db8f 100644 --- a/src/gtk/filesel.c +++ b/src/gtk/filesel.c @@ -175,15 +175,8 @@ static GList *filesel_create(const gchar *title, const gchar *path, tmp = g_strdup(realpath); gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(chooser), tmp); g_free(tmp); - if (action == GTK_FILE_CHOOSER_ACTION_SAVE) { - tmp = NULL; - if (g_utf8_validate(filename, -1, NULL)) - tmp = g_filename_from_utf8(filename, -1, NULL, NULL, NULL); - if (tmp == NULL) - tmp = g_strdup(filename); - gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(chooser), tmp); - g_free(tmp); - } + if (action == GTK_FILE_CHOOSER_ACTION_SAVE) + gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(chooser), filename); g_free(realpath); } else { gchar *tmp = NULL; -- 1.7.4.1