[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs and UTF-8 locale
From: |
Eli Zaretskii |
Subject: |
Re: Emacs and UTF-8 locale |
Date: |
Tue, 18 Dec 2001 15:38:19 +0200 (IST) |
On Tue, 18 Dec 2001, Markus Kuhn wrote:
> The proper way of determining the encoding used by the current locale is
> not to look at a single locale variable, but to query the Single Unix
> Specification (and now also POSIX) function nl_langinfo(CODESET), as for
> example in
>
> utf8_mode = (strcmp(nl_langinfo(CODESET), "UTF-8") == 0);
Thanks. This is something that should be added to Emacs. For now, Emacs
implements the backup procedure, which is the Lisp equivalent of the
following:
> 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;
> }
>
> It is important that you do not only test LANG, but the first variable
> in the sequence LC_ALL, LC_CTYPE and LANG that has a value.
That is what Emacs does.
- Re: Emacs and UTF-8 locale, Markus Kuhn, 2001/12/18
- Re: Emacs and UTF-8 locale,
Eli Zaretskii <=
- Re: Emacs and UTF-8 locale, Tomohiro KUBOTA, 2001/12/18
- Re: Emacs and UTF-8 locale, Eli Zaretskii, 2001/12/18
- Re: Emacs and UTF-8 locale, Dave Love, 2001/12/19
- Re: Emacs and UTF-8 locale, Paul Eggert, 2001/12/19
- Re: Emacs and UTF-8 locale, Eli Zaretskii, 2001/12/19
- Re: Emacs and UTF-8 locale, Dave Love, 2001/12/21
- Re: Emacs and UTF-8 locale, Eli Zaretskii, 2001/12/22
- Re: Emacs and UTF-8 locale, Dave Love, 2001/12/21
Re: Emacs and UTF-8 locale, Dave Love, 2001/12/19