utf8-io
defines several utilities for performing UTF-8 I/O.
[ReadStr
] and [WriteStr
] are traits which extend [Read
] and [Write
]
providing read_str
and write_str
functions for reading and writing UTF-8
data.
[Utf8Reader
] and [Utf8Writer
] implement ReadStr
and WriteStr
and
wrap arbitrary Read
and Write
implementations. Utf8Reader
translates
invalid UTF-8 encodings into replacements (U+FFFD), while Utf8Writer
reports errors on invalid UTF-8 encodings. Both ensure that scalar values
are never split at the end of a buffer.
[Utf8Duplexer
] represents an interactive stream and implements both
ReadStr
and WriteStr
.