From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: Accessing the environment's locale encoding settings Date: Thu, 15 Dec 2011 20:08:31 +0100 Message-ID: <87fwglejps.fsf@gnu.org> References: <877h30exfk.fsf@gnu.org> <201111160300.38410.bruno@clisp.org> <87r5189wxw.fsf@gnu.org> <201111201755.18910.bruno@clisp.org> <87ehx2bsis.fsf@gnu.org> <1321818250.84716.YahooMailNeo@web37905.mail.mud.yahoo.com> <878vn6l8qf.fsf@gnu.org> <87d3ch6jdv.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1323976124 24198 80.91.229.12 (15 Dec 2011 19:08:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Dec 2011 19:08:44 +0000 (UTC) Cc: Bruno Haible , guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Dec 15 20:08:40 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RbGfX-0001ay-Lc for guile-devel@m.gmane.org; Thu, 15 Dec 2011 20:08:39 +0100 Original-Received: from localhost ([::1]:56639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbGfX-0006KR-1a for guile-devel@m.gmane.org; Thu, 15 Dec 2011 14:08:39 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:38295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbGfV-0006KM-1L for guile-devel@gnu.org; Thu, 15 Dec 2011 14:08:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbGfT-0002rD-TE for guile-devel@gnu.org; Thu, 15 Dec 2011 14:08:37 -0500 Original-Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:9683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbGfT-0002r6-Ia for guile-devel@gnu.org; Thu, 15 Dec 2011 14:08:35 -0500 X-IronPort-AV: E=Sophos;i="4.71,359,1320620400"; d="scan'208";a="123555425" Original-Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 15 Dec 2011 20:08:33 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 Frimaire an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87d3ch6jdv.fsf@netris.org> (Mark H. Weaver's message of "Thu, 24 Nov 2011 21:11:40 -0500") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.105 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13120 Archived-At: Hi, Apologies for not answering earlier, and for making changes without continuing this discussion. So here=E2=80=99s an after-the-fact reply. Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> It=E2=80=99s not completely satisfying either because --locale is not in >> 2.0.[0-3], so users who really need it will need some configury; >> furthermore, from 2.2.x on, it will be mostly unneeded. >> >> Yet, a choice has to be made between this hack and the other one. :-) >> >> Thoughts? > > I like the --locale argument, except that the default (if there is no > --locale argument) should be to either (A) call setlocale(LC_ALL, "") or > (B) do something like the other hack, where the arguments are decoded as > if the locale had been temporarily set according to the environment > variables. > > My strong preference would be Option A. The problem I see with changing the default to call setlocale(LC_ALL, "") is that %default-port-encoding would no longer match the current locale, as is currently the case. Or we=E2=80=99d have to change its defau= lt value. But I thought this would be too disruptive in either case, and thus I stick to Option B. > If you are trying to maintain backward compatibility, keep in mind that > for most practical purposes, Guile 1.8 acts closer to option A than the > other options. Furthermore, Option A is the Right Thing moving forward, > and matches what Guile 2.2 will do. > > If we accept only ASCII arguments by default, then _most_ Guile scripts > will need to add the --locale argument, but only for versions after > 2.0.3. More likely, many authors won't bother with this ugliness, and > their scripts will be broken for non-ASCII locales. Yes, I thought about that too, and thought it counted against Option A. So the current situation is: =E2=80=A2 In 2.0, one still has to call =E2=80=98setlocale=E2=80=99 impli= citly, but command-line arguments are converted from the locale encoding suggested by the environment variables (commit ed4c3739668b4b111b38555b8bc101cb74c87c1c). =E2=80=A2 In 2.1, the =E2=80=98setlocale=E2=80=99 call is implicit when t= he =E2=80=98guile=E2=80=99 executable is used (commit bb9b357e2b98cea82f844115ee5f66704bb6a1c8). The %default-port-encoding value is still Latin-1, but presumably that would need to be changed to the current locale encoding. Thoughts? Nothing=E2=80=99s set in stone and I=E2=80=99m glad to revisit the situatio= n. Thanks, Ludo=E2=80=99.