From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#32329: call-with-input-file and call-with-output-file should use textual ports Date: Thu, 02 Aug 2018 10:44:58 -0400 Message-ID: <87600sx1xx.fsf@netris.org> References: <87tvofswqj.fsf@teapot.weinholt.se> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1533223455 14194 195.159.176.226 (2 Aug 2018 15:24:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 2 Aug 2018 15:24:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 32329-done@debbugs.gnu.org To: =?UTF-8?Q?G=C3=B6ran?= Weinholt Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Aug 02 17:24:10 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flFSU-0003bG-Hs for guile-bugs@m.gmane.org; Thu, 02 Aug 2018 17:24:10 +0200 Original-Received: from localhost ([::1]:46285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flFUb-0002Li-39 for guile-bugs@m.gmane.org; Thu, 02 Aug 2018 11:26:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flEsc-00012W-Jv for bug-guile@gnu.org; Thu, 02 Aug 2018 10:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flEsZ-0007VS-9u for bug-guile@gnu.org; Thu, 02 Aug 2018 10:47:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34083) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1flEsZ-0007VJ-64 for bug-guile@gnu.org; Thu, 02 Aug 2018 10:47:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1flEsY-00041t-Vi for bug-guile@gnu.org; Thu, 02 Aug 2018 10:47:03 -0400 Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-To: bug-guile@gnu.org Resent-Date: Thu, 02 Aug 2018 14:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 32329 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 32329@debbugs.gnu.org, mhw@netris.org, goran@weinholt.se Original-Received: via spool by 32329-done@debbugs.gnu.org id=D32329.153322119115445 (code D ref 32329); Thu, 02 Aug 2018 14:47:02 +0000 Original-Received: (at 32329-done) by debbugs.gnu.org; 2 Aug 2018 14:46:31 +0000 Original-Received: from localhost ([127.0.0.1]:39099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flEs3-000413-0V for submit@debbugs.gnu.org; Thu, 02 Aug 2018 10:46:31 -0400 Original-Received: from world.peace.net ([64.112.178.59]:52184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1flEs0-00040p-Fi for 32329-done@debbugs.gnu.org; Thu, 02 Aug 2018 10:46:28 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1flEru-00089K-Dt; Thu, 02 Aug 2018 10:46:22 -0400 In-Reply-To: <87tvofswqj.fsf@teapot.weinholt.se> ("=?UTF-8?Q?G=C3=B6ran?= Weinholt"'s message of "Tue, 31 Jul 2018 09:14:12 +0200") 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" Xref: news.gmane.org gmane.lisp.guile.bugs:9099 Archived-At: Hi G=C3=B6ran, G=C3=B6ran Weinholt writes: > the call-with-input-file and call-with-output-file procedures in (rnrs > io simple) should open textual ports. In Guile 2.2.4, they open binary > ports: > > (define (call-with-input-file filename proc) > (call-with-port (open-file-input-port filename) proc)) > > (define (call-with-output-file filename proc) > (call-with-port (open-file-output-port filename) proc)) > > Changing the inner calls to open-input-file and open-output-file is > sufficient to fix this bug. > > A consequence of using binary ports here is that the I/O is not > transcoded, so UTF-8 data is corrupted. Fixed in commit 4c91de3e45e7c98d5b7c484509fe5c59bd70f9fd on the 'stable-2.2' branch. Thanks! Mark