From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 03 22:35:06 2016 Received: (at submit) by debbugs.gnu.org; 4 Mar 2016 03:35:06 +0000 Received: from localhost ([127.0.0.1]:60724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1abgWA-000533-CM for submit@debbugs.gnu.org; Thu, 03 Mar 2016 22:35:06 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39824) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1abgW8-00052W-Lc for submit@debbugs.gnu.org; Thu, 03 Mar 2016 22:35:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abgW2-0004xZ-6j for submit@debbugs.gnu.org; Thu, 03 Mar 2016 22:34:58 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abgW2-0004xV-3u for submit@debbugs.gnu.org; Thu, 03 Mar 2016 22:34:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abgW1-0001on-4P for bug-guile@gnu.org; Thu, 03 Mar 2016 22:34:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abgW0-0004xJ-70 for bug-guile@gnu.org; Thu, 03 Mar 2016 22:34:57 -0500 Received: from river6.fysh.org ([2001:41d0:d:20da::2]:39735 helo=river.fysh.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abgW0-0004xF-0U for bug-guile@gnu.org; Thu, 03 Mar 2016 22:34:56 -0500 Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1abgVw-0002Et-9K; Fri, 04 Mar 2016 03:34:52 +0000 Date: Fri, 4 Mar 2016 03:34:52 +0000 From: Zefram To: bug-guile@gnu.org Subject: GUILE_INSTALL_LOCALE not equivalent to setlocale Message-ID: <20160304033452.GB1318@fysh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) The documentation claims that setting GUILE_INSTALL_LOCALE=1 in the environment is equivalent to calling (setlocale LC_ALL "") at startup. Actually there is at least one difference: calling setlocale causes ports (both primordial and later-opened) to be initially configured for the locale's nominal character encoding, but setting the environment variable does not. Setting the environment variable leaves the port encoding at #f, functioning as ISO-8859-1, just as if locale had not been invoked at all. I do see some effects from setting the environment variable, specifically message strings affecting strftime. $ echo -n $'L\xc3\xa9on' | LANG=de_DE.UTF-8 guile-2.0 -c '(write (strftime "%c" (gmtime 1000000000))) (newline) (write (port-encoding (current-input-port))) (newline) (write (map char->integer (let r ((l '\''())) (let ((c (read-char (current-input-port)))) (if (eof-object? c) (reverse l) (r (cons c l))))))) (newline)' "Sun Sep 9 01:46:40 2001" #f (76 195 169 111 110) $ echo -n $'L\xc3\xa9on' | GUILE_INSTALL_LOCALE=1 LANG=de_DE.UTF-8 guile-2.0 -c '(write (strftime "%c" (gmtime 1000000000))) (newline) (write (port-encoding (current-input-port))) (newline) (write (map char->integer (let r ((l '\''())) (let ((c (read-char (current-input-port)))) (if (eof-object? c) (reverse l) (r (cons c l))))))) (newline)' "So 09 Sep 2001 01:46:40 GMT" #f (76 195 169 111 110) $ echo -n $'L\xc3\xa9on' | LANG=de_DE.UTF-8 guile-2.0 -c '(setlocale LC_ALL "") (write (strftime "%c" (gmtime 1000000000))) (newline) (write (port-encoding (current-input-port))) (newline) (write (map char->integer (let r ((l '\''())) (let ((c (read-char (current-input-port)))) (if (eof-object? c) (reverse l) (r (cons c l))))))) (newline)' "So 09 Sep 2001 01:46:40 GMT" "UTF-8" (76 233 111 110) In case anyone trawls the archives later investigating the usage of GUILE_INSTALL_LOCALE: I am not attempting to use it myself, despite the scenario implied by the above test cases. I think it's a bloody stupid mechanism, imposing on the program something that needs to be under the program's control, and which previously was. I'm actually investigating how to make programs cope with the unpredictable situation caused by this mechanism with the unpredictable environment setting. -zefram From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 20 12:16:59 2016 Received: (at 22902) by debbugs.gnu.org; 20 Jun 2016 16:16:59 +0000 Received: from localhost ([127.0.0.1]:47934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bF1sh-0004yD-5s for submit@debbugs.gnu.org; Mon, 20 Jun 2016 12:16:59 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:61839 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bF1sf-0004wy-C9 for 22902@debbugs.gnu.org; Mon, 20 Jun 2016 12:16:57 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 3797B23570; Mon, 20 Jun 2016 12:16:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=XD+nhmsMu41xlJa0bcK+hqnbQrg=; b=j4/oZm BtJ9RXyzCU4ejvIQ8oiorvfMRBYVVhWLZIZ0MYjSDjJyaZqQzhKBzNdIRdQZZXVv I+aQoPmxwqP4NhgWNjQo02afaJODDu1X7Ycgkw3/jYiaPIgivmO+KaqcNJ6RS62Z FoL4p+sLTtIGLp9zSE1+sit/0dejYePciNKeM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=g4R3FDy5Ca5nHm2e0q4d8Q/A6JF3Jlqo Gt8j3RL271mIFeHCsmr6e1c1bUOLHckh03BUu5irlwv+eHLXRVYCHAngWpJJb0hu gt8Zh0bDc6bO28al2eFJiq5S9o4xpn288cRMFfNvWhN+N687mIR43eEFoQWRA9nD IMoUAhfDkK4= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 2FF742356F; Mon, 20 Jun 2016 12:16:55 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 4B7D42356C; Mon, 20 Jun 2016 12:16:54 -0400 (EDT) From: Andy Wingo To: Zefram Subject: Re: bug#22902: GUILE_INSTALL_LOCALE not equivalent to setlocale References: <20160304033452.GB1318@fysh.org> Date: Mon, 20 Jun 2016 18:16:46 +0200 In-Reply-To: <20160304033452.GB1318@fysh.org> (zefram@fysh.org's message of "Fri, 4 Mar 2016 03:34:52 +0000") Message-ID: <878txzg7ip.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 67731904-3702-11E6-B4CA-C1836462E9F6-02397024!pb-sasl1.pobox.com X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 22902 Cc: 22902@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) On Fri 04 Mar 2016 04:34, Zefram writes: > The documentation claims that setting GUILE_INSTALL_LOCALE=1 in the > environment is equivalent to calling (setlocale LC_ALL "") at startup. > Actually there is at least one difference: calling setlocale causes ports > (both primordial and later-opened) to be initially configured for the > locale's nominal character encoding, but setting the environment variable > does not. Setting the environment variable leaves the port encoding at > #f, functioning as ISO-8859-1, just as if locale had not been invoked > at all. I do see some effects from setting the environment variable, > specifically message strings affecting strftime. Indeed! Thank you for this analysis; I was wondering why I was getting terrible backtraces in Guile master. Andy From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 07 17:53:14 2016 Received: (at 22902-done) by debbugs.gnu.org; 7 Aug 2016 21:53:15 +0000 Received: from localhost ([127.0.0.1]:59291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWW0Q-0002oe-O7 for submit@debbugs.gnu.org; Sun, 07 Aug 2016 17:53:14 -0400 Received: from pb-sasl2.pobox.com ([64.147.108.67]:61324 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWW0N-0002oU-TZ for 22902-done@debbugs.gnu.org; Sun, 07 Aug 2016 17:53:13 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id A832130B0D; Sun, 7 Aug 2016 17:53:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=N6IE0XEcrix1MOwlxdnSCfdf4yg=; b=noGfuG i+kNzr7LjCyIX026hrXdia58Zf9oNNvwNODxYvq5OyBXRmHv9mfRF1TEFKSF2D62 7eUVtXd8BQcNnfwFA8fGY4ooXFNn4zZObpkDps+fScEIZb621vKo4xf9r2NAWeJ1 PBab6AtzoS1UuTFOP8Auy3mJo0gEsISZNvnCs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=UMPzMze07K0IzhcZo2sI/VU5smy1wC9Y Ngyy/HOsoSOmkxXHrDiwcjgC8/xTtDV4sOsgXtaOEhBUVtBvwCw0sDUpYJojCVl+ BpNNVo9L5nAD6dzVLF1g6HXMtB12A490MtVMsavcxPbWAd2tKTvQ7TqZwc0pVjtK skLcEnPfCMk= Received: from pb-sasl2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl2.pobox.com (Postfix) with ESMTP id A186730B0C; Sun, 7 Aug 2016 17:53:11 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl2.pobox.com (Postfix) with ESMTPSA id F2D7430B0B; Sun, 7 Aug 2016 17:53:10 -0400 (EDT) From: Andy Wingo To: Zefram Subject: Re: bug#22902: GUILE_INSTALL_LOCALE not equivalent to setlocale References: <20160304033452.GB1318@fysh.org> Date: Sun, 07 Aug 2016 23:53:04 +0200 In-Reply-To: <20160304033452.GB1318@fysh.org> (zefram@fysh.org's message of "Fri, 4 Mar 2016 03:34:52 +0000") Message-ID: <87d1lknt4v.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 557DD6A0-5CE9-11E6-BCE6-28A6F1301B6D-02397024!pb-sasl2.pobox.com X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 22902-done Cc: 22902-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) On Fri 04 Mar 2016 04:34, Zefram writes: > The documentation claims that setting GUILE_INSTALL_LOCALE=1 in the > environment is equivalent to calling (setlocale LC_ALL "") at startup. > Actually there is at least one difference: calling setlocale causes ports > (both primordial and later-opened) to be initially configured for the > locale's nominal character encoding, but setting the environment variable > does not. Setting the environment variable leaves the port encoding at > #f, functioning as ISO-8859-1, just as if locale had not been invoked > at all. I do see some effects from setting the environment variable, > specifically message strings affecting strftime. I believe this is fixed in both 2.0 and master. Thanks for the report. Andy From unknown Thu Jun 19 14:20:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 05 Sep 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator