[R6RS] Changing the transcoding mid-stream
William D Clinger
will at ccs.neu.edu
Sat Aug 19 08:38:03 EDT 2006
Mike wrote:
> Indeed, "no transcoder" isn't the same as specifying a UTF-8
> transcoder, and the sentence you quoted is highly misleading. Sorry
> about that. As long as no transcoder is associated with the port,
> the various binary I/O procedures deal with the binary data without
> doing any interpretation of it as UTF-8.
Okay. With that clarification, I agree that the proposal
can be used to perform what I mean by binary i/o.
There are at least seven places scattered throughout the current
draft of port-io-srfi.html where having no transcoder is alleged
to be equivalent to UTF-8 or to translate to UTF-8. All of these
allegations should be corrected.
I also think the proposal needs a (no-codec) or (binary-codec)
procedure. Without it, the two proposals we are considering
for allowing a port that was opened with one transcoding tc0
to be read or written with another transcoding tc1 would allow
tc1 to be the UTF-8 transcoding, but would not allow tc1 to be
the default ("no", "binary") transcoding.
> Even a
>
> (transcoder (eol-style (eol-style crlf)))
>
> would only ever look for #x0a and #x0d bytes and translate those,
> ignoring the rest.
I think a lot of programmers are likely to make the
mistakes I made in reading these specifications, so
I think it would be a good idea to add a note warning
that the end-of-line translations are performed even
for procedures such as read-u8 and write-u8.
> No, but there's `open-bytes-input-port', and that does.
Sorry, I missed that.
Will
More information about the R6RS
mailing list