diff -ur tcsh-6.13.00/config.h.in tcsh/config.h.in --- tcsh-6.13.00/config.h.in 2004-09-14 20:01:21.622550088 +0200 +++ tcsh/config.h.in 2004-09-14 19:40:59.835289984 +0200 @@ -3,6 +3,9 @@ /* Define to 1 if you have the iconv () interface */ #undef HAVE_ICONV +/* Define to 1 if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff -ur tcsh-6.13.00/configure tcsh/configure diff -ur tcsh-6.13.00/configure.in tcsh/configure.in --- tcsh-6.13.00/configure.in 2004-09-14 20:01:21.624549784 +0200 +++ tcsh/configure.in 2004-09-14 19:34:44.314377840 +0200 @@ -257,6 +257,7 @@ ;; esac +AC_CHECK_FUNCS([nl_langinfo]) AC_SEARCH_LIBS(crypt, crypt) AC_SEARCH_LIBS(tgetent, termlib termcap curses) AC_SEARCH_LIBS(gethostbyname, nsl) diff -ur tcsh-6.13.00/sh.set.c tcsh/sh.set.c --- tcsh-6.13.00/sh.set.c 2004-09-14 20:01:21.647546288 +0200 +++ tcsh/sh.set.c 2004-09-14 19:35:06.276039160 +0200 @@ -37,6 +37,10 @@ #include "ed.h" #include "tw.h" +#ifdef HAVE_NL_LANGINFO +#include +#endif + extern Char HistLit; extern bool GotTermCaps; int numeof = 0; @@ -1254,7 +1258,29 @@ { STRSTARKUTF8, STRKUTF8 }, { NULL, NULL } }; +#ifdef HAVE_NL_LANGINFO + struct dspm_autoset_Table dspmc[] = { + { STRSTARKUTF8, STRKUTF8 }, + { STRKEUC, STRKEUC }, + { STRGB2312, STRKEUC }, + { STRKBIG5, STRKBIG5 }, + { NULL, NULL } + }; + Char *codeset; + codeset = str2short(nl_langinfo(CODESET)); + if (*codeset != '\0') { + for (i = 0; dspmc[i].n; i++) { + Char *estr; + if (dspmc[i].n[0] && t_pmatch(pcp, dspmc[i].n, &estr, 0) > 0) { + set(CHECK_MBYTEVAR, Strsave(dspmc[i].v), VAR_READWRITE); + update_dspmbyte_vars(); + return; + } + } + } +#endif + if (*pcp == '\0') return; diff -ur tcsh-6.13.00/tc.const.c tcsh/tc.const.c --- tcsh-6.13.00/tc.const.c 2004-09-14 20:01:21.579556624 +0200 +++ tcsh/tc.const.c 2004-09-14 19:31:30.274876328 +0200 @@ -129,6 +129,8 @@ Char STRKBIG5[] = { 'b', 'i', 'g', '5', '\0' }; Char STRKUTF8[] = { 'u', 't', 'f', '8', '\0' }; Char STRSTARKUTF8[] = { '*', 'u', 't', 'f', '*', '8', '\0' }; +Char STRGB2312[] = { 'g', 'b', '2', '3', '1', '2', '\0' }; + # ifdef MBYTEDEBUG /* Sorry, use for beta testing */ Char STRmbytemap[] = { 'm', 'b', 'y', 't', 'e', 'm', 'a', 'p', '\0' }; # endif /* MBYTEMAP */