From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Zefram Newsgroups: gmane.lisp.guile.bugs Subject: bug#22910: read-only setlocale has side effect Date: Fri, 4 Mar 2016 19:55:00 +0000 Message-ID: <20160304195500.GA14310@fysh.org> References: <20160304164859.GE7946@fysh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1457121382 6430 80.91.229.3 (4 Mar 2016 19:56:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2016 19:56:22 +0000 (UTC) To: 22910@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 04 20:56:12 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1abvpc-0005ar-7B for guile-bugs@m.gmane.org; Fri, 04 Mar 2016 20:56:12 +0100 Original-Received: from localhost ([::1]:43264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abvpb-0003wr-Lo for guile-bugs@m.gmane.org; Fri, 04 Mar 2016 14:56:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abvpX-0003vy-Ow for bug-guile@gnu.org; Fri, 04 Mar 2016 14:56:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abvpS-0003C6-N7 for bug-guile@gnu.org; Fri, 04 Mar 2016 14:56:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abvpS-0003C1-K0 for bug-guile@gnu.org; Fri, 04 Mar 2016 14:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1abvpS-0000Wd-EU for bug-guile@gnu.org; Fri, 04 Mar 2016 14:56:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Zefram Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 04 Mar 2016 19:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22910 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 22910-submit@debbugs.gnu.org id=B22910.14571213061931 (code B ref 22910); Fri, 04 Mar 2016 19:56:02 +0000 Original-Received: (at 22910) by debbugs.gnu.org; 4 Mar 2016 19:55:06 +0000 Original-Received: from localhost ([127.0.0.1]:34083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1abvoX-0000V5-T3 for submit@debbugs.gnu.org; Fri, 04 Mar 2016 14:55:06 -0500 Original-Received: from river.fysh.org ([87.98.248.19]:48810 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1abvoW-0000Uw-Um for 22910@debbugs.gnu.org; Fri, 04 Mar 2016 14:55:05 -0500 Original-Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1abvoS-0004EY-2y; Fri, 04 Mar 2016 19:55:00 +0000 Content-Disposition: inline In-Reply-To: <20160304164859.GE7946@fysh.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7979 Archived-At: Additional information: setlocale's side effect on primordial ports happens even if the port's encoding has been individually set using set-port-encoding!. This means that to maintain a specific encoding on these ports (other than the locale's nominal encoding, which is likely to not be binary compatible) it is necessary to set the encoding repeatedly, before any I/O operation after setlocale might have been called. Since the read-only mode of setlocale has this effect, and arbitrary library code might feel entitled to call setlocale for read purposes without documenting that it does so, this really amounts to setting the encoding before every I/O operation. -zefram