diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c index 9a5132dc..d0462aaa 100644 --- a/src/fe-text/irssi.c +++ b/src/fe-text/irssi.c @@ -42,6 +42,7 @@ #include "textbuffer-reformat.h" #include +#include #ifdef HAVE_STATIC_PERL void perl_core_init(void); @@ -333,6 +334,14 @@ int main(int argc, char **argv) textdomain(PACKAGE); #endif + /* setlocale() must be called at the beginning before any calls that + affect it, especially regexps seem to break if they're generated + before t his call. + + locales aren't actually used for anything else than autodetection + of UTF-8 currently.. */ + setlocale(LC_CTYPE, ""); + textui_init(); args_register(options); args_execute(argc, argv); diff --git a/src/fe-text/term.c b/src/fe-text/term.c index 03004b10..a36e68fa 100644 --- a/src/fe-text/term.c +++ b/src/fe-text/term.c @@ -27,7 +27,6 @@ #include "mainwindows.h" #ifdef HAVE_NL_LANGINFO -# include # include #endif @@ -155,7 +154,6 @@ void term_common_init(void) read_settings(); #if defined (HAVE_NL_LANGINFO) && defined(CODESET) - setlocale(LC_CTYPE, ""); if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) { term_type = TERM_TYPE_UTF8; term_set_input_type(TERM_TYPE_UTF8);