[R6RS] BOM-based codecs

Michael Sperber sperber at informatik.uni-tuebingen.de
Mon Aug 14 13:23:09 EDT 2006

I suggest adding a codec returned by a nullary procedure


that will return a codec for a meta-encoding based on the Unicode
byte-order mark.  This codec will only work for input ports, and raise
an exception if used for an output port.

For an input port with a transcoder with such a codec, the first
attempt to read from the port will read 2, 3 or 4 bytes from the port
that determine the actual encoding according the following table:

FE FF       UTF-16be
FF FE       UTF-16le
00 00 FE FF UTF-32be
FF FE 00 00 UTF-32le

Will, is that what you had in mind as far as the BOM is concerned?

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

More information about the R6RS mailing list