psppire-syntax-window: Recode file from final encoding, not original one.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 4 Apr 2014 04:59:47 +0000 (21:59 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 4 Apr 2014 04:59:47 +0000 (21:59 -0700)
When syntax_load() reads a syntax file, it can guess the correct encoding
using encoding_guess_whole_file().  When it does that, it's supposed to
use the guessed encoding to recode the file data into UTF-8.  In fact, it
was using the original (NULL or "") encoding, which didn't work out well.
This commit makes it use the guessed encoding.

Bug #41975.
Reported by Mindaugas.

src/ui/gui/psppire-syntax-window.c

index 35f57e587b4cc950f30eaf8ef40683426e7b46e4..8491eb3142c7be207f6f3d3d7d67d3498380c611 100644 (file)
@@ -984,7 +984,7 @@ syntax_load (PsppireWindow *window, const gchar *filename,
       sw->encoding = g_strdup (encoding);
     }
 
-  text_utf8 = recode_substring_pool ("UTF-8", encoding,
+  text_utf8 = recode_substring_pool ("UTF-8", sw->encoding,
                                      ss_buffer (text_locale, len_locale),
                                      NULL).string;
   free (text_locale);