emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs and UTF-8 locale


From: Tomohiro KUBOTA
Subject: Re: Emacs and UTF-8 locale
Date: Tue, 18 Dec 2001 23:37:40 +0900
User-agent: Wanderlust/2.6.1 (Upside Down) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryƍmae) APEL/10.3 Emacs/20.7 (i386-debian-linux-gnu) MULE/4.1 (AOI)

Hi,

At Tue, 18 Dec 2001 15:38:19 +0200 (IST),
Eli Zaretskii wrote:

> >   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.

Why limiting to UTF-8?  Since LC_CTYPE locale is widely used not
only for UTF-8 encodings but also for various encodings, and since
GNU Emacs supports such various encodings, I think it is a good idea
to use LC_CTYPE locale not only for detecting UTF-8 mode but also
for detecting other encodings such as ISO-8859-*, KOI8-*, EUC-*,
TIS-620, Big5, and so on.

---
Tomohiro KUBOTA <address@hidden>
http://www.debian.or.jp/~kubota/
"Introduction to I18N"  http://www.debian.org/doc/manuals/intro-i18n/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]