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)) {

Edmund
--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to