X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-data-window.c;h=35ffdb840f403836b2376a168100939331ef5541;hb=f23643cfa3b4c6b9a5fe0cd890a8d1b7240a8552;hp=a0c4b9645aa62ef27dedadaa4d5b91da67ae7283;hpb=378b066491cc80d34f31683357c05be853250b80;p=pspp diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index a0c4b9645a..35ffdb840f 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation + Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ #include "ui/gui/helper.h" #include "ui/gui/psppire-data-window.h" #include "ui/gui/psppire-dialog-action.h" +#include "ui/gui/psppire-encoding-selector.h" #include "ui/gui/psppire-syntax-window.h" #include "ui/gui/psppire-window.h" #include "ui/gui/psppire.h" @@ -445,10 +446,12 @@ sysfile_info (PsppireDataWindow *de) struct string filename; gchar *file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - gchar *utf8_file_name = g_filename_to_utf8 (file_name, -1, NULL, NULL, NULL); + const gchar *encoding = psppire_encoding_selector_get_encoding ( + gtk_file_chooser_get_extra_widget (GTK_FILE_CHOOSER (dialog))); + gchar *syntax; ds_init_empty (&filename); @@ -457,7 +460,11 @@ sysfile_info (PsppireDataWindow *de) g_free (utf8_file_name); - syntax = g_strdup_printf ("SYSFILE INFO %s.", ds_cstr (&filename)); + if (encoding) + syntax = g_strdup_printf ("SYSFILE INFO %s ENCODING='%s'.", + ds_cstr (&filename), encoding); + else + syntax = g_strdup_printf ("SYSFILE INFO %s.", ds_cstr (&filename)); g_free (execute_syntax_string (de, syntax)); }