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 bug report
#32329: call-with-input-file and call-with-output-file should use textual ports
which was filed against the guile package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 32329 <at> debbugs.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)]
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
[Message part 3 (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
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.