Re: Detecting UTF-8 Locale Question

From: James H. Cloos Jr. (cloos@jhcloos.com)
Date: Tue Mar 25 2003 - 18:12:53 EST

  • Next message: Anto'nio Martins-Tuva'lkin: "Re: U+00D0, U+01b7 -- variants or distinct chars?"

    >>>>> "Edward" == Edward H Trager <ehtrager@umich.edu> writes:

    Edward> (1) Is examination of the LC_CTYPE environment variable on
    Edward> UNIX-like environments a sufficient way of detecting locale?

    If you are going to look at the env yourself, rather than using the
    relevant libraries, you must look at more than just LC_CTYPE.

    The progression is:

        LC_ALL overrides LC_CTYPE overrides LANG

    So, first check LC_ALL; if that is not set then check LC_CTYPE; if
    that is also not set check LANG; if that is not set the locale is C.

    That should match the behavior of POSIX compliant libraries.

    -JimC



    This archive was generated by hypermail 2.1.5 : Tue Mar 25 2003 - 19:03:35 EST