Re: Detecting UTF-8 Locale Question

From: Muhammad Asif (mdasif@wol.net.pk)
Date: Tue Mar 25 2003 - 23:46:58 EST

  • Next message: Jungshik Shin: "Re: Detecting UTF-8 Locale Question"

    My initial plan for finding out about the current locale is that the
    program will, at start up, look at the LC_CTYPE environment variable. If
    that variable is defined and contains the substring "UTF-8" or regex-able
    variants thereof (like "utf8" on Linux), then everything is fine. If not
    present, the program prints a warning message to the user suggesting they
    set the locale to a UTF-8 locale and provides an example of how to do
    that. If the locale is not set properly, the program still functions, but
    of course any UTF-8 encoded data will not be displayed properly on the
    terminal.

    (Of course, even if a locale *is* set to a UTF-8 locale, it doesn't
    guarantee that UTF-8 data will be displayed properly because (1) glyphs
    still may not be available in the fonts on the system (2) the terminal may
    not handle the script properly (i.e., when I last checked, xterm didn't
    handle Indic or RTL scripts)).

    I haven't much exp. with UNIX but for Multilingual apps this approach will
    be work without any problem. Fortunately in web env. (where most of time i
    worked) browser support UTF-8 all we need to do is to detect user lang.
    pref and render data in utf-8. But i believe above approach will work fine
    except limits you mentioned already about fonts and capabilities of user
    client (xterminals).

    Asif



    This archive was generated by hypermail 2.1.5 : Wed Mar 26 2003 - 00:35:27 EST