[R6RS] I/O questions for everyone: encoding errors

William D Clinger will at ccs.neu.edu
Tue Jul 18 13:52:20 EDT 2006


Mike wrote:
> 1. If one of the read-char and read-string... procedures encounters an
>    invalid encoding, should it:
>
>    a) skip the first byte of the invalid encoding and treat it as=20
>       U+FFFD (REPLACEMENT CHARACTER)
>    b) skip the first byte of the invalid encoding and ignore it
>    c) raise a continuable exception that allows the handler to specify
>       what the decoding should be
>    d) do one of the above depending on an (optional) configuration
>       option specified upon opening the port.

In decreasing order of preference:
  c)
  a)
  d)

Note that d) implies the complexity of a) and c) combined.
I prefer c) because that corresponds to what I consider to
be the only reasonable answer you offered for the second
question.

> 2. If one of the write-char and write-string... procedures gets=20
>    passed a character that the transcoder of the port cannot encode,
>    should it:
>
>    a) encode the U+003F (QUESTION MARK) character instead
>    b) try to encode the U+FFFD (REPLACEMENT CHARACTER), and, if that
>       fails, do one of the other options
>    c) ignore the character
>    d) raise a continuable exception that allows the handler to specify
>       what the encoding should be
>    d) do one of the above depending on an (optional) configuration
>       option specified upon opening the port.

  d) the first

Will



More information about the R6RS mailing list