utf8-io

Crates.ioutf8-io
lib.rsutf8-io
version0.19.1
sourcesrc
created_at2021-01-28 23:33:35.92177
updated_at2023-06-29 22:47:48.313954
descriptionTraits and types for UTF-8 I/O
homepage
repositoryhttps://github.com/sunfishcode/utf8-io
max_upload_size
id347811
size111,746
Dan Gohman (sunfishcode)

documentation

README

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.

Commit count: 76

cargo fmt