From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?G=C3=B6ran?= Weinholt Newsgroups: gmane.lisp.guile.bugs Subject: bug#32329: call-with-input-file and call-with-output-file should use textual ports Date: Tue, 31 Jul 2018 09:14:12 +0200 Message-ID: <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 1533022982 753 195.159.176.226 (31 Jul 2018 07:43:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Jul 2018 07:43:02 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) To: 32329@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Jul 31 09:42:57 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 1fkPJ3-0008TY-MY for guile-bugs@m.gmane.org; Tue, 31 Jul 2018 09:42:57 +0200 Original-Received: from localhost ([::1]:57402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkPLA-00049c-7n for guile-bugs@m.gmane.org; Tue, 31 Jul 2018 03:45:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkPL4-00049D-Tk for bug-guile@gnu.org; Tue, 31 Jul 2018 03:45:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkPL4-0007AL-4f for bug-guile@gnu.org; Tue, 31 Jul 2018 03:45:02 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58939) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkPL4-0007AD-0M for bug-guile@gnu.org; Tue, 31 Jul 2018 03:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fkPL3-00028l-QD for bug-guile@gnu.org; Tue, 31 Jul 2018 03:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?G=C3=B6ran?= Weinholt Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 31 Jul 2018 07:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32329 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15330230618161 (code B ref -1); Tue, 31 Jul 2018 07:45:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Jul 2018 07:44:21 +0000 Original-Received: from localhost ([127.0.0.1]:35724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkPKP-00027Z-Cq for submit@debbugs.gnu.org; Tue, 31 Jul 2018 03:44:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkPKM-00027L-ID for submit@debbugs.gnu.org; Tue, 31 Jul 2018 03:44:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkPKG-0006vv-KW for submit@debbugs.gnu.org; Tue, 31 Jul 2018 03:44:13 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56435) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fkPKG-0006vr-H2 for submit@debbugs.gnu.org; Tue, 31 Jul 2018 03:44:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkPKF-0003sn-E6 for bug-guile@gnu.org; Tue, 31 Jul 2018 03:44:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkPKE-0006vE-Gi for bug-guile@gnu.org; Tue, 31 Jul 2018 03:44:11 -0400 Original-Received: from iustitia.weinholt.se ([2a02:28f0:0:a::7dce:e5a8]:56408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fkPKE-0006sv-52 for bug-guile@gnu.org; Tue, 31 Jul 2018 03:44:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=weinholt.se ; s=iustitia2012; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=9vmszMzI/lLwH/IlclLNRvFpDPrd3OIx4pa74mmxvwE=; b=b7VE3RlaKnXY++9644nI/1kabf /KwrwMVQtvqin+e/lZMLZdGp9D9NepvaUT5LEUXC3QHgCYGrB7RNdRM2NGzQm1uDOb0lPbomUh29Z DO3oslzogiBmSAGsNMD3AZr72Susk9wPnuhBDSDWthTy2UajJsAZgCRfmSTBqYjsFkQrMPn84r79Z 5SZniKfv5phFUYWEiW8BqJRIy8Wp4me/eZIUpacYdZgAx2P1EKL1/P70/uv1kWkZ3rF9o1Cff354C /KoywGFRtNcoBCws/+vydWpGAbMfV+IRIXbEUUQmC6YaXmQNPlvuZExkWAJsMaqBdTw/V2bn8Y+Fz Ob/AZH1Q==; Original-Received: from uucp by iustitia.weinholt.se with local-bsmtp (Exim 4.89) (envelope-from ) id 1fkPKA-00059D-8K; Tue, 31 Jul 2018 09:44:06 +0200 Original-Received: from weinholt by teapot.weinholt.se with local (Exim 4.91) (envelope-from ) id 1fkOrE-00041o-NV; Tue, 31 Jul 2018 09:14:12 +0200 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:9098 Archived-At: Hello schemers, 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. --=20 G=C3=B6ran Weinholt Debian developer 73 de SA6CJK