From f4c1b605edc2801b7d06f4117add4467119d1d05 Mon Sep 17 00:00:00 2001 From: Valentin Batz Date: Wed, 12 Jan 2005 12:10:48 +0000 Subject: call setlocale(LC_ALL, ) before g_get_charset to properly return the user's charset git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3702 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/recode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/recode.c b/src/core/recode.c index e073169e..95060e91 100644 --- a/src/core/recode.c +++ b/src/core/recode.c @@ -25,6 +25,8 @@ #include "lib-config/iconfig.h" #include "misc.h" +#include + #ifdef HAVE_GLIB2 static gboolean recode_get_charset(const char **charset) { @@ -32,7 +34,9 @@ static gboolean recode_get_charset(const char **charset) if (**charset) /* we use the same test as in src/fe-text/term.c:123 */ return !g_strcasecmp(*charset, "utf-8"); - + + /* we have to set LC_ALL to "" to get the charset of the user */ + setlocale(LC_ALL, ""); return g_get_charset(charset); } #endif -- cgit v1.2.3