unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: "Göran Weinholt" <goran@weinholt.se>
Cc: 32329-done@debbugs.gnu.org
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	[thread overview]
Message-ID: <87600sx1xx.fsf@netris.org> (raw)
In-Reply-To: <87tvofswqj.fsf@teapot.weinholt.se> ("Göran Weinholt"'s message of "Tue, 31 Jul 2018 09:14:12 +0200")

Hi Göran,

Göran Weinholt <goran@weinholt.se> 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





      reply	other threads:[~2018-08-02 14:44 UTC|newest]

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

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=87600sx1xx.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=32329-done@debbugs.gnu.org \
    --cc=goran@weinholt.se \
    /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).