Convert filename encodings when opening files.
[pspp-builds.git] / src / ui / gui / psppire-data-window.c
index c754f73038f69e49238b2c881e004f7f65a0c4ad..8eb0a143b5af0060d8682d754e534cd2e3f30c57 100644 (file)
@@ -53,7 +53,6 @@
 #include "crosstabs-dialog.h"
 #include "frequencies-dialog.h"
 #include "examine-dialog.h"
-#include "dict-display.h"
 #include "regression-dialog.h"
 #include "oneway-anova-dialog.h"
 #include "t-test-independent-samples-dialog.h"
@@ -347,11 +346,18 @@ dump_rm (GtkRecentManager *rm)
 static gboolean
 load_file (PsppireWindow *de, const gchar *file_name)
 {
+  gchar *native_file_name;
   struct getl_interface *sss;
   struct string filename;
 
   ds_init_empty (&filename);
-  syntax_gen_string (&filename, ss_cstr (file_name));
+
+  native_file_name =
+    convert_glib_filename_to_system_filename (file_name, NULL);
+
+  syntax_gen_string (&filename, ss_cstr (native_file_name));
+
+  g_free (native_file_name);
 
   sss = create_syntax_string_source ("GET FILE=%s.",
                                     ds_cstr (&filename));
@@ -359,10 +365,7 @@ load_file (PsppireWindow *de, const gchar *file_name)
   ds_destroy (&filename);
 
   if (execute_syntax (sss) )
-    {
-      psppire_window_set_filename (de, file_name);
-      return TRUE;
-    }
+    return TRUE;
 
   return FALSE;
 }