Edmund GRIMLEY EVANS wrote on 2001-12-18 14:01 UTC:
> Markus Kuhn <[EMAIL PROTECTED]>:
>
> > There is at the moment only one widely used system that does not yet
> > implement nl_langinfo(3) or locale(1) (namely *BSD), and on such a
> > system, you can do as a fallback something like
> >
> > char *s;
> > int utf8_mode = 0;
> >
> > if ((s = getenv("LC_ALL")) ||
> > (s = getenv("LC_CTYPE")) ||
> > (s = getenv("LANG"))) {
> > if (strstr(s, "UTF-8"))
> > utf8_mode = 1;
> > }
>
> Or, preferably:
>
> if (((s = getenv("LC_ALL")) && *s) ||
> ((s = getenv("LC_CTYPE")) && *s) ||
> ((s = getenv("LANG")) && *s)) {
Thanks, I changed it in the FAQ. Could the maintainers of xterm, less,
etc. do the same please?
Reason: It says on
http://www.opengroup.org/onlinepubs/7908799/xbd/envvar.html
indeed "If the LANG environment variable is defined and is not null, the
^^^^^^^^^^^^^^^
value of the LANG environment variable is used." etc. Similarly on
http://www.opengroup.org/onlinepubs/7908799/xcu/locale.html
Please always provide proper references.
Markus
--
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org, WWW: <http://www.cl.cam.ac.uk/~mgk25/>
--
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/