From b20b80bfeb88eca603cb5c10b5a7188387fd23fd Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 3 Apr 2014 21:59:47 -0700 Subject: [PATCH] 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. --- src/ui/gui/psppire-syntax-window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.30.2