| Crates.io | utf8-fix |
| lib.rs | utf8-fix |
| version | 0.1.1 |
| created_at | 2025-11-17 18:41:22.820697+00 |
| updated_at | 2025-11-18 07:12:01.502643+00 |
| description | Fix invalid UTF-8 sequences in-place while preserving buffer size - useful for fuzzing and mutation testing |
| homepage | |
| repository | https://gitlab.com/andrzej1_1/utf8-fix |
| max_upload_size | |
| id | 1937319 |
| size | 10,589 |
= utf8-fix
Rust library for fixing invalid UTF-8 sequences in-place.
== Overview
This library processes byte slices containing potentially invalid UTF-8 data and fixes common encoding errors:
Valid UTF-8 sequences are preserved unchanged. The buffer size remains the same - invalid codepoints are replaced with valid ones of the same byte length.
== Use Cases
This library is particularly useful for:
== Usage
use utf8_fix::fix_utf8_string; use rand::thread_rng;
let mut data = b"Hello, world!".to_vec(); let mut rng = thread_rng();
== Features
This library is no_std by default.
std: Enables standard library support including Display and Error trait implementations.To use with std: