To work with mixed binary/textual I/O, the following R6RS-compatible procedures are proposed:
- (read-blob [])
- (read-blob! [])
- (write-blob [])
- (write-partial-blob [])
- (utf8->string )
- (string->utf8 )
It's an error to pass invalid bytes to utf8->string
. A plausible recovery strategy is to convert each invalid byte into a U+FFFD character.
Write-partial-blob
would be merged into write-blob
if the same is done for blob copying.