summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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