24 releases (breaking)

0.19.1 Jun 29, 2023
0.18.0 Jun 12, 2023
0.17.0 Mar 7, 2023
0.16.0 Nov 27, 2022
0.4.0 Mar 2, 2021

#339 in Text processing

Download history 10/week @ 2024-06-16 11/week @ 2024-06-23 2/week @ 2024-06-30 3/week @ 2024-07-07 9/week @ 2024-07-14 2/week @ 2024-07-21 97/week @ 2024-07-28 8/week @ 2024-08-04 2/week @ 2024-08-11 38/week @ 2024-08-18 34/week @ 2024-08-25 19/week @ 2024-09-01 3/week @ 2024-09-08 36/week @ 2024-09-22 52/week @ 2024-09-29

91 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.2–8.5MB
~85K SLoC