bug#76163: Badly treated eol-style (end of line style) in R6RS transcoders.
Yuval Langer <[email protected]> Sun, 9 Feb 2025 20:50:15 +0200
| Newsgroups | gmane.lisp.guile.bugs |
|---|---|
| Message-ID | <CAK0OjG0vBVZfhPnuDije4rzgu7VZQYDD1G-xxHkM94P8St9+ZQ@mail.gmail.com> |
When running the `transcoders.scm` script (file attached) in Guile: ``` $ guile transcoders.scm ``` I get the output: ``` "abc\r" ``` but it should be: ``` "abc" ``` When running Chez Scheme: ``` $ chezscheme --script transcoders.scm ``` I get the right output: ``` "abc" ``` This is due to faulty transcoders in Guile, maybe? My `guile --version` says `guile (GNU Guile) 3.0.9`, and `chezscheme --version` says `9.5.4`. Many thanks, Yuval Langer.
transcoders.scm
(text/x-scheme, 484 B)
(import
(rnrs io ports)
(rnrs bytevectors))
(let* ([x (string->utf8 "abc\r\ndef\r\n")]
[input-port-from-bytevector (open-bytevector-input-port x)]
[transcoder (make-transcoder (utf-8-codec)
(eol-style crlf))]
[text-port (transcoded-port input-port-from-bytevector
transcoder)]
[a-line (get-line text-port)])
(write a-line)
(newline)
a-line) ;; => "abc\r", but should be "abc"