summaryrefslogtreecommitdiff
path: root/src/core/recode.c
diff options
context:
space:
mode:
authorValentin Batz <senneth@irssi.org>2005-01-12 12:10:48 +0000
committervb <vb@dbcabf3a-b0e7-0310-adc4-f8d773084564>2005-01-12 12:10:48 +0000
commitf4c1b605edc2801b7d06f4117add4467119d1d05 (patch)
tree73750f8733603dc1651605e19bac33edf1fc3597 /src/core/recode.c
parentecae975c2b7d0ba93da76fd5c6b1b63392d8248f (diff)
downloadirssi-f4c1b605edc2801b7d06f4117add4467119d1d05.zip
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
Diffstat (limited to 'src/core/recode.c')
-rw-r--r--src/core/recode.c6
1 files changed, 5 insertions, 1 deletions
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 <locale.h>
+
#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