X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Date: Sun, 18 Sep 2011 00:49:42 +0200 From: David Sastre To: cygwin AT cygwin DOT com Subject: Re: cygwin started speaking German today Message-ID: <20110917224942.GA11205@jethro.local.lan> References: <7856072A9D04C24B82DFE2B1112FE38A0C27492B56 AT MCHP058A DOT global-ad DOT net> <201109081246 DOT 23238 DOT bruno AT clisp DOT org> <4E68AF35 DOT 9030002 AT cwilson DOT fastmail DOT fm> <201109082344 DOT 55506 DOT bruno AT clisp DOT org> <4E69D9EA DOT 2050004 AT cwilson DOT fastmail DOT fm> <20110909145921 DOT GA27289 AT calimero DOT vinschen DOT de> <4E6F7AA1 DOT 4090808 AT redhat DOT com> <20110917204041 DOT GC28100 AT jethro DOT local DOT lan> <4E751602 DOT 8070201 AT cornell DOT edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <4E751602.8070201@cornell.edu> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 17, 2011 at 05:49:54PM -0400, Ken Brown wrote: > On 9/17/2011 4:40 PM, David Sastre wrote: > >On Tue, Sep 13, 2011 at 09:45:37AM -0600, Eric Blake wrote: > >>On 09/09/2011 08:59 AM, Corinna Vinschen wrote: > >>>On Sep 9 13:33, Andy Koppe wrote: > >>>>The 'C.UTF-8' default locale is not a bug, it was a deliberate design= decision. > >>> > >>>Exactly. And it has been discussed a lot on the cygwin-apps mailing > >>>list. > >>> > >>>And above all, there *is* an official way for the user to align the > >>>Cygwin locale with the Windows locale, see the -s and -u options > >>>of the locale(1) command: > >>> > >>> http://cygwin.com/cygwin-ug-net/using-utils.html#locale > >> > >>On 09/09/2011 09:09 AM, Corinna Vinschen wrote: > >>>>OK, then the following four facilities are needed in Cygwin. > >>>> > >>>>1) We need the name of the locale which is in effect when the user has > >>>> not specified environment variables. > >>> > >>>In Fedora, for instance, the fallback is what is set as system default > >>>in /etc/sysconfig/i18n. > >>> > >>>In Cygwin the fallback is the system default set in > >>/etc/profile.d/lang.sh > >>>or /etc/profile.d/lang.csh. > >>> > >>>Why should libintl use anything else on Cygwin, but not on Linux? > >>> > >> > >>Given this, I think the bug is in cygwin for having base files > >>/etc/profile.d/lang.{sh,csh} which hardcode LANG to C.UTF-8 instead > >>of using locale -s -u to default LANG to the preferred Windows > >>settings. Libintl should NOT be second-guessing an explicit setting > >>of LANG, but cygwin should NOT be explicitly setting LANG to C.UTF-8 > >>in its default startup scripts without any regards to the Windows > >>settings. Whether setlocale(LC_ALL,"") returns C.UTF-8 or a > >>Windows-appropriate string _when LANG is undefined_ is still worth > >>solving, but right now, an out-of-the-box cygwin installation > >>_always has LANG defined_ by the default startup scripts. So our > >>first focus should be to get that setting of LANG fixed to honor > >>Windows, and to teach libintl that when LANG is set we really meant > >>it. > > > >WRT the base-files package, would it be acceptable/does it make sense to= set: > > > >test -z "${LC_ALL:-${LC_CTYPE:-$LANG}}"&& export LANG=3D${locale -sU} > > > >in /etc/profile.d/lang.sh and > > > >if ( $?LC_ALL =3D=3D 0&& $?LC_CTYPE =3D=3D 0&& $?LANG =3D=3D 0 ) seten= v LANG =3D `locale -sU` > > > >in /etc/profile.d/lang.csh, both as proposed, _and_ a (possibly) comment= ed-out > > > >test -z "${LC_ALL:-${LC_CTYPE:-$LANG}}"&& export LANG=3D${locale -uU} > > > >in the skeletal .bash_profile and .profile (i.e. both system-wide and > >user defined settings)? >=20 > If you want the user-defined setting to take effect, wouldn't you > have to omit the `test -z ...'? LANG will already be set when > .bash_profile is processed. Indeed, excuse the fast copy-paste. The proposal still stands. --=20 Huella de clave primaria: AD8F BDC0 5A2C FD5F A179 60E7 F79B AB04 5299 EC56 --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EAREIAAYFAk51JAYACgkQ95urBFKZ7FYVUgD+N6SKs6mD7zbBsDtzHYEdkMzW 8czMP02lZf6LThFHH4AA/Rnck344ON9R4pcZXzpARN5+P22LySy7f8TAqBP30n+C =LDq+ -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--