utf8_reader

Crates.ioutf8_reader
lib.rsutf8_reader
version0.7.0
sourcesrc
created_at2024-05-10 13:04:24.747119
updated_at2024-05-12 13:05:59.679596
descriptionA UTF-8 reader that read UTF-8 characters from object that implement Read trait
homepagehttps://github.com/dvorakchen/utf8reader
repositoryhttps://github.com/dvorakchen/utf8reader
max_upload_size
id1235994
size17,159
(dvorakchen)

documentation

https://docs.rs/utf8_reader/

README

utf8_reader

Read utf-8 characters from object that implement Read trait

Usage

use utf8_reader::Utf8Reader;
use std::io::Cursor;
use std::io::Write;

let mut buf = Cursor::new(Vec::new());
buf.write("复/d❤".as_bytes()).unwrap();
buf.set_position(0);

let mut reader = Utf8Reader::new(buf);

assert_eq!(Some('复'.into()), reader.next());
assert_eq!(Some('/'.into()), reader.next());
assert_eq!(Some('d'.into()), reader.next());
assert_eq!(Some('❤'.into()), reader.next());
assert_eq!(None, reader.next());

Note: This Utf8Reader would not validate whether the content is a valid UTF-8

Commit count: 12

cargo fmt