16 breaking releases

0.16.0 Nov 27, 2022
0.14.0 Nov 8, 2022
0.13.0 Jun 16, 2022
0.12.0 Mar 16, 2022
0.4.0 Mar 2, 2021

#126 in Operating systems

Download history 63/week @ 2022-10-07 7/week @ 2022-10-14 15/week @ 2022-10-21 22/week @ 2022-10-28 70/week @ 2022-11-04 30/week @ 2022-11-11 27/week @ 2022-11-18 100/week @ 2022-11-25 17/week @ 2022-12-02 54/week @ 2022-12-09 19/week @ 2022-12-16 20/week @ 2022-12-23 11/week @ 2022-12-30 14/week @ 2023-01-06 29/week @ 2023-01-13 31/week @ 2023-01-20

89 downloads per month
Used in 4 crates

Apache-2.0…

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.3–5.5MB
~92K SLoC