I think I get what is going on here. PSPP doesn't open the .sav file, but opens an empty syntax window.
On psppire-data-window.c:457-463 there is:

gchar *name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));

if (any_reader_may_open (name))
  psppire_window_load (de, name);
else
  open_syntax_window (name);

According to gtk docs (http://library.gnome.org/devel/gtk/stable/GtkFileChooser.html#gtkfilechooser-encodings)
gtk_file_chooser_get_filename doesn't return the filename on utf8.
But it is passed to any_reader_may_open without any conversion. any_reader_may_open can't identify any
reader to the file, returns false and pspp thinks the file is a syntax file.

The attached patch may fix it. Sadly I can't compile a windows version now, because of a problem on my VM, so I can't test it. But at least on UTF8 profiles, nothing seems to be changed with the patch.

Michel
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:
_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to