mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04: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
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user