13 releases (breaking)

0.9.1 Nov 19, 2021
0.8.0 Nov 12, 2021
0.5.0 Jul 14, 2021
0.4.0 Mar 2, 2021

#73 in Operating systems

Download history 14/week @ 2021-08-08 97/week @ 2021-08-15 18/week @ 2021-08-22 2/week @ 2021-08-29 5/week @ 2021-09-05 43/week @ 2021-09-12 10/week @ 2021-09-19 25/week @ 2021-10-03 18/week @ 2021-10-10 5/week @ 2021-10-17 5/week @ 2021-10-24 6/week @ 2021-10-31 39/week @ 2021-11-07 65/week @ 2021-11-14 17/week @ 2021-11-21

127 downloads per month
Used in 4 crates

Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT

58KB
1.5K SLoC

utf8-io

Traits and types for UTF-8 I/O

Github Actions CI Status crates.io page docs.rs docs

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.

Similar crates

Utf8Reader is similar utf8-read, but differs in that it silently turns invalid byte sequences into replacement characters rather than reporting an error.

Dependencies

~0.2–1.8MB
~46K SLoC