unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: "Göran Weinholt" <goran@weinholt.se>
To: 32329@debbugs.gnu.org
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	[thread overview]
Message-ID: <87tvofswqj.fsf@teapot.weinholt.se> (raw)

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.

-- 
Göran Weinholt
Debian developer
73 de SA6CJK





             reply	other threads:[~2018-07-31  7:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31  7:14 Göran Weinholt [this message]
2018-08-02 14:44 ` bug#32329: call-with-input-file and call-with-output-file should use textual ports Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvofswqj.fsf@teapot.weinholt.se \
    --to=goran@weinholt.se \
    --cc=32329@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).