From: Ben Pfaff Date: Fri, 4 Apr 2014 04:59:47 +0000 (-0700) Subject: psppire-syntax-window: Recode file from final encoding, not original one. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=b20b80bfeb88eca603cb5c10b5a7188387fd23fd psppire-syntax-window: Recode file from final encoding, not original one. 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. --- diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index 35f57e587b..8491eb3142 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -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);