16 releases (breaking)

0.12.0 Mar 16, 2022
0.10.0 Dec 24, 2021
0.9.1 Nov 19, 2021
0.5.0 Jul 14, 2021
0.4.0 Mar 2, 2021

#86 in Operating systems

Download history 32/week @ 2022-01-24 90/week @ 2022-01-31 21/week @ 2022-02-07 13/week @ 2022-02-14 35/week @ 2022-02-21 10/week @ 2022-02-28 10/week @ 2022-03-07 86/week @ 2022-03-14 58/week @ 2022-03-21 19/week @ 2022-03-28 23/week @ 2022-04-04 10/week @ 2022-04-11 12/week @ 2022-04-18 118/week @ 2022-04-25 143/week @ 2022-05-02 34/week @ 2022-05-09

307 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.4MB
~35K SLoC