Crates.io | utf8-parser |
lib.rs | utf8-parser |
version | 0.1.0 |
source | src |
created_at | 2023-12-14 01:10:26.675893 |
updated_at | 2024-10-11 15:50:49.3859 |
description | A one-byte-at-a-time UTF-8 parser |
homepage | |
repository | https://github.com/Property404/utf8-parser |
max_upload_size | |
id | 1069014 |
size | 31,823 |
A stateful one-byte-at-a-time UTF-8 parser. This is useful for things like building characters from bytes pulled from a UART.
use utf8_parser::Utf8Parser;
let mut parser = Utf8Parser::new();
assert!(parser.push(0xf0).unwrap().is_none());
assert!(parser.push(0x9f).unwrap().is_none());
assert!(parser.push(0x8e).unwrap().is_none());
assert_eq!(parser.push(0x84).unwrap(), Some('🎄'));
Licensed under either of
at your option.