Binary ports shouldn't have a transcoder

Bug #176225 reported by Michael D. Adams on 2007-12-13
4
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Undecided
Unassigned

Bug Description

I can't sure until Bug #176224 is fixed, but it appears that the binary ports are undergoing Unicode transformations.

R6RS-lib says they shouldn't in 8.2.4:
A binary port is a port that supports binary I/O, does not
have an associated transcoder and does not support textual
I/O.

I can't test this because of Bug #176224, but based on the output of other programs, I think the following program will output 2 bytes when it should output only 1:
(import (rnrs))
(put-u8 (standard-output-port) 175)
(flush-output-port (standard-output-port))

Abdulaziz Ghuloum (aghuloum) wrote :

That was the case before the new IO implementation (say rev 1203 and earlier I think). Now, this is what I got:

$ cat t.ss
(import (rnrs))
(let ([p (standard-output-port)])
  (put-u8 p 175)
  (flush-output-port p))
$ ikarus --r6rs-script t.ss | wc
       0 1 1

Also:
> (port-transcoder (standard-output-port))
#f

Abdulaziz Ghuloum (aghuloum) wrote :

I said:
> That was the case before the new IO implementation [...]

I take that back. put-u8 always outputted one byte, otherwise, I couldn't have generated the bootfiles. It was the case however that if you (put-char p (integer->char 175)), you'd get a 2-byte output since all ports were utf8-transcoded.

Michael D. Adams (mdmkolbe) wrote :

You're right, I was looking at the wrong data. Marking invalid.

Changed in ikarus:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions