utf8-parser

Crates.ioutf8-parser
lib.rsutf8-parser
version0.1.0
sourcesrc
created_at2023-12-14 01:10:26.675893
updated_at2024-10-11 15:50:49.3859
descriptionA one-byte-at-a-time UTF-8 parser
homepage
repositoryhttps://github.com/Property404/utf8-parser
max_upload_size
id1069014
size31,823
Dagan Martinez (Property404)

documentation

README

utf8-parser

A stateful one-byte-at-a-time UTF-8 parser. This is useful for things like building characters from bytes pulled from a UART.

Repository crates.io Documentation

Example

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('🎄'));

Similar crates

License

Licensed under either of

at your option.

Commit count: 47

cargo fmt