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

#246 in Text processing

Download history 1/week @ 2023-12-24 15/week @ 2024-01-07 14/week @ 2024-01-14 4/week @ 2024-01-21 9/week @ 2024-02-04 1/week @ 2024-02-11 72/week @ 2024-02-18 62/week @ 2024-02-25 22/week @ 2024-03-03 35/week @ 2024-03-10 9/week @ 2024-03-17 38/week @ 2024-03-24 313/week @ 2024-03-31

400 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–10MB
~91K SLoC