diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index ae8a796..c5d1665 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -454,15 +454,26 @@ open_window (GtkAction *action, PsppireWindow *de) { case GTK_RESPONSE_ACCEPT: { + gchar *name_utf8; + GError *err = NULL; gchar *name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + name_utf8 = g_filename_to_utf8 (name, -1, NULL, NULL, &err); + if ( NULL == name_utf8) + { + g_warning ("Cannot convert filename from filename encoding to UTF8: %s", + err->message); + g_clear_error (&err); + } + if (any_reader_may_open (name)) psppire_window_load (de, name); else open_syntax_window (name); g_free (name); + g_free (name_utf8); } break; default: