GNU bug report logs -
#32329
call-with-input-file and call-with-output-file should use textual ports
Previous Next
Reported by: Göran Weinholt <goran <at> weinholt.se>
Date: Tue, 31 Jul 2018 07:45:01 UTC
Severity: normal
Done: Mark H Weaver <mhw <at> netris.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Thu, 02 Aug 2018 10:44:58 -0400
with message-id <87600sx1xx.fsf <at> netris.org>
and subject line Re: bug#32329: call-with-input-file and call-with-output-file should use textual ports
has caused the debbugs.gnu.org bug report #32329,
regarding call-with-input-file and call-with-output-file should use textual ports
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
32329: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32329
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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
[Message part 3 (message/rfc822, inline)]
Hi Göran,
Göran Weinholt <goran <at> 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
This bug report was last modified 6 years and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.