|
From: | Ken Brown |
Subject: | Re: Emacs fails to use default locale |
Date: | Sat, 28 Nov 2009 10:20:35 -0500 |
User-agent: | Thunderbird 2.0.0.23 (Windows/20090812) |
On 11/27/2009 1:06 PM, Ken Brown wrote:
On 11/27/2009 10:49 AM, Jan Djärv wrote:Ken Brown skrev:According to http://www.opengroup.org/onlinepubs/007908799/xbd/envvar.htmlif LC_ALL, LC_CTYPE, and LANG are all either unset or empty, then the implementation-dependent default locale is supposed to be used. My understanding is that this should be done by using setlocale(LC_CTYPE, ""). But emacs's locale initialization seems to just use the environment variables, so it doesn't pick up the default locale if the variables are unset.setlocale(LC_ALL, "") is the way. Emacs does that if LC_ALL is unset or not "C".However, because of internal reasons, Emacs also does: /* The Emacs Lisp reader needs LC_NUMERIC to be "C", so that numbers are read and printed properly for Emacs Lisp. */ setlocale (LC_NUMERIC, "C");Can you describe in more detail the problem you are seeing? I.e. what output is wrong?I'm working in Cygwin 1.7, which has recently adopted a default locale that uses UTF-8 encoding. If I start emacs with none of the locale variables set, emacs appears to assume an ASCII character set. (I don't see "U" in the mode line, for instance.) Moreover, C-h C returns the error message "Unknown button type `help-xref'".When I referred to emacs's locale initialization in my original post, I was referring to the code in lisp/international/mule-cmds.el.
Maybe the problem (or at least part of the problem) is that mule-cmds.el doesn't call (locale-info 'codeset) when the CODESET can't be determined from environment variables.
Ken
[Prev in Thread] | Current Thread | [Next in Thread] |