From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.devel Subject: Re: Emacs fails to use default locale Date: Sat, 28 Nov 2009 10:20:35 -0500 Message-ID: <4B113FC3.2060203@cornell.edu> References: <4B0D80A6.8010208@cornell.edu> <4B0FF503.9090008@swipnet.se> <4B101541.8000300@cornell.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1259421658 22950 80.91.229.12 (28 Nov 2009 15:20:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Nov 2009 15:20:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 28 16:20:51 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NEP6J-00074x-F0 for ged-emacs-devel@m.gmane.org; Sat, 28 Nov 2009 16:20:43 +0100 Original-Received: from localhost ([127.0.0.1]:36959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NEP6I-00087t-Qw for ged-emacs-devel@m.gmane.org; Sat, 28 Nov 2009 10:20:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NEP6B-00086o-TG for emacs-devel@gnu.org; Sat, 28 Nov 2009 10:20:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NEP67-00082c-4f for emacs-devel@gnu.org; Sat, 28 Nov 2009 10:20:35 -0500 Original-Received: from [199.232.76.173] (port=47448 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NEP66-00082Z-VA for emacs-devel@gnu.org; Sat, 28 Nov 2009 10:20:31 -0500 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141]:33880 helo=authusersmtp.mail.cornell.edu) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NEP66-0001AJ-SA for emacs-devel@gnu.org; Sat, 28 Nov 2009 10:20:30 -0500 Original-Received: from [192.168.1.6] (cpe-67-241-20-9.twcny.res.rr.com [67.241.20.9]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.13.1/8.12.10) with ESMTP id nASFKSv9007951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 28 Nov 2009 10:20:29 -0500 (EST) User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <4B101541.8000300@cornell.edu> X-MIME-Autoconverted: from 8bit to quoted-printable by authusersmtp.mail.cornell.edu id nASFKSv9007951 X-detected-operating-system: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117907 Archived-At: On 11/27/2009 1:06 PM, Ken Brown wrote: > On 11/27/2009 10:49 AM, Jan Dj=E4rv wrote: >> Ken Brown skrev: >>> According to >>> >>> http://www.opengroup.org/onlinepubs/007908799/xbd/envvar.html >>> >>> if LC_ALL, LC_CTYPE, and LANG are all either unset or empty, then the= =20 >>> implementation-dependent default locale is supposed to be used. My=20 >>> understanding is that this should be done by using=20 >>> setlocale(LC_CTYPE, ""). But emacs's locale initialization seems to=20 >>> just use the environment variables, so it doesn't pick up the default= =20 >>> locale if the variables are unset. >>> >> >> setlocale(LC_ALL, "") is the way. Emacs does that if LC_ALL is unset=20 >> 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= =20 >> output is wrong? >=20 > I'm working in Cygwin 1.7, which has recently adopted a default locale=20 > that uses UTF-8 encoding. If I start emacs with none of the locale=20 > variables set, emacs appears to assume an ASCII character set. (I don'= t=20 > see "U" in the mode line, for instance.) Moreover, C-h C returns the=20 > error message "Unknown button type `help-xref'". >=20 > When I referred to emacs's locale initialization in my original post, I= =20 > 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=20 doesn't call (locale-info 'codeset) when the CODESET can't be determined=20 from environment variables. Ken