| Crates.io | rawstring |
| lib.rs | rawstring |
| version | 0.1.2 |
| created_at | 2025-11-05 17:18:23.776093+00 |
| updated_at | 2025-11-05 19:18:57.87843+00 |
| description | A string type that can hold data which may or may not be valid UTF-8. |
| homepage | |
| repository | https://github.com/imaybnero/rawstring |
| max_upload_size | |
| id | 1918281 |
| size | 15,113 |
rawstring provides a string type that can hold data that may or not be valid UTF-8.
Rust's standard [String] and &str types require valid UTF-8,
which can be limiting when working with arbitrary binary data.
This crate provides the following types as alternatives:
RawStr]: a borrowed view of raw string dataRawString]: an owned raw string type[RawStr] and [RawString] differ from &[u8] and Vec<u8> in that they
are treated as text rather than binary data. For example, both types' [Debug] and [Display]
implementations handle invalid UTF-8 gracefully by replacing invalid sequences
with the Unicode replacement character (�). This makes them suitable for logging,
user output, and other contexts where human-readable text is desired.
This project is licensed under the MIT License. See the LICENSE file for details.