… | |
… | |
46 | |
46 | |
47 | #ifdef HAVE_XSETLOCALE |
47 | #ifdef HAVE_XSETLOCALE |
48 | # define X_LOCALE |
48 | # define X_LOCALE |
49 | # include <X11/Xlocale.h> |
49 | # include <X11/Xlocale.h> |
50 | #else |
50 | #else |
51 | # ifdef HAVE_SETLOCALE |
|
|
52 | # include <locale.h> |
51 | # include <locale.h> |
53 | # endif |
|
|
54 | #endif |
52 | #endif |
55 | |
53 | |
56 | #ifdef HAVE_NL_LANGINFO |
54 | #ifdef HAVE_NL_LANGINFO |
57 | # include <langinfo.h> |
55 | # include <langinfo.h> |
58 | #endif |
56 | #endif |
… | |
… | |
985 | void |
983 | void |
986 | rxvt_term::set_locale (const char *locale) |
984 | rxvt_term::set_locale (const char *locale) |
987 | { |
985 | { |
988 | set_environ (envv); |
986 | set_environ (envv); |
989 | |
987 | |
990 | #if HAVE_XSETLOCALE || HAVE_SETLOCALE |
|
|
991 | free (this->locale); |
988 | free (this->locale); |
992 | this->locale = setlocale (LC_CTYPE, locale); |
989 | this->locale = setlocale (LC_CTYPE, locale); |
993 | |
990 | |
994 | if (!this->locale) |
991 | if (!this->locale) |
995 | { |
992 | { |
… | |
… | |
1006 | |
1003 | |
1007 | |
1004 | |
1008 | this->locale = strdup (this->locale); |
1005 | this->locale = strdup (this->locale); |
1009 | SET_LOCALE (this->locale); |
1006 | SET_LOCALE (this->locale); |
1010 | mbstate.reset (); |
1007 | mbstate.reset (); |
1011 | #endif |
|
|
1012 | |
1008 | |
1013 | #if HAVE_NL_LANGINFO |
1009 | #if HAVE_NL_LANGINFO |
1014 | char *codeset = nl_langinfo (CODESET); |
1010 | char *codeset = nl_langinfo (CODESET); |
1015 | // /^UTF.?8/i |
1011 | // /^UTF.?8/i |
1016 | enc_utf8 = (codeset[0] == 'U' || codeset[0] == 'u') |
1012 | enc_utf8 = (codeset[0] == 'U' || codeset[0] == 'u') |