wiki:BlobIoShinn

Version 1 (modified by cowan, 6 years ago) (diff)

Moved from PortsShinn

To work with mixed binary/textual I/O, the following R6RS-compatible procedures are proposed:

  • (read-blob <length> [<input-port>])
  • (read-blob! <blob> <length> [<input-port>])
  • (write-blob <blob> [<output-port>])
  • (utf8->string <blob>)
  • (string->utf8 <string>)

The utf8->string procedure converts invalid bytes into U+FFFD characters.