From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 31 03:44:21 2018 Received: (at submit) by debbugs.gnu.org; 31 Jul 2018 07:44:21 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=disabled version=3.3.2 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 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 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 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==; 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 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 From: =?utf-8?Q?G=C3=B6ran?= Weinholt To: bug-guile@gnu.org Subject: 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-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: -6.0 (------) 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 02 10:46:31 2018 Received: (at 32329-done) by debbugs.gnu.org; 2 Aug 2018 14:46:31 +0000 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 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 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 From: Mark H Weaver To: =?utf-8?Q?G=C3=B6ran?= Weinholt Subject: Re: bug#32329: call-with-input-file and call-with-output-file should use textual ports References: <87tvofswqj.fsf@teapot.weinholt.se> Date: Thu, 02 Aug 2018 10:44:58 -0400 In-Reply-To: <87tvofswqj.fsf@teapot.weinholt.se> (=?utf-8?Q?=22G=C3=B6ran?= Weinholt"'s message of "Tue, 31 Jul 2018 09:14:12 +0200") Message-ID: <87600sx1xx.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32329-done Cc: 32329-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: -1.0 (-) 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 From unknown Tue Jun 24 17:24:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 31 Aug 2018 11:24:04 +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