mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 17:12:51 +02:00
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
This commit is contained in:
parent
ecae975c2b
commit
f4c1b605ed
1 changed files with 5 additions and 1 deletions
|
|
@ -25,6 +25,8 @@
|
||||||
#include "lib-config/iconfig.h"
|
#include "lib-config/iconfig.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
#ifdef HAVE_GLIB2
|
#ifdef HAVE_GLIB2
|
||||||
static gboolean recode_get_charset(const char **charset)
|
static gboolean recode_get_charset(const char **charset)
|
||||||
{
|
{
|
||||||
|
|
@ -32,7 +34,9 @@ static gboolean recode_get_charset(const char **charset)
|
||||||
if (**charset)
|
if (**charset)
|
||||||
/* we use the same test as in src/fe-text/term.c:123 */
|
/* we use the same test as in src/fe-text/term.c:123 */
|
||||||
return !g_strcasecmp(*charset, "utf-8");
|
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);
|
return g_get_charset(charset);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue