Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunfishcode/utf8-io
Traits and types for UTF-8 I/O
https://github.com/sunfishcode/utf8-io
library rust
Last synced: 5 days ago
JSON representation
Traits and types for UTF-8 I/O
- Host: GitHub
- URL: https://github.com/sunfishcode/utf8-io
- Owner: sunfishcode
- License: other
- Created: 2021-01-27T22:41:20.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-30T16:18:16.000Z (over 1 year ago)
- Last Synced: 2024-05-09T14:39:54.616Z (6 months ago)
- Topics: library, rust
- Language: Rust
- Homepage:
- Size: 67.4 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
`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.[`utf8-read`]: https://crates.io/crates/utf8-read
[`ReadStr`]: https://docs.rs/utf8-io/latest/utf8_io/trait.ReadStr.html
[`WriteStr`]: https://docs.rs/utf8-io/latest/utf8_io/trait.WriteStr.html
[`Utf8Reader`]: https://docs.rs/utf8-io/latest/utf8_io/struct.Utf8Reader.html
[`Utf8Writer`]: https://docs.rs/utf8-io/latest/utf8_io/struct.Utf8Writer.html
[`Utf8Duplexer`]: https://docs.rs/utf8-io/latest/utf8_io/struct.Utf8Duplexer.html