mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
call setlocale(LC_ALL, ) once in fe-text/irssi.c and not everytime recode_get_charset() is called in recode.c
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3703 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
f4c1b605ed
commit
b5f93b6164
@ -25,8 +25,6 @@
|
||||
#include "lib-config/iconfig.h"
|
||||
#include "misc.h"
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef HAVE_GLIB2
|
||||
static gboolean recode_get_charset(const char **charset)
|
||||
{
|
||||
@ -34,9 +32,7 @@ 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
|
||||
|
@ -362,6 +362,10 @@ int main(int argc, char **argv)
|
||||
of UTF-8 currently.. */
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
||||
/* to get the users's charset with g_get_charset() properly you have
|
||||
to call setlocale(LC_ALL, "") aswell */
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
textui_init();
|
||||
args_register(options);
|
||||
args_execute(argc, argv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user