This is an old revision of the document!
Reading Character by Character
You can use the relision::decoder module to iterate through a stream character by character. The decoder is based on the https://encoding.spec.whatwg.org/ and handles UTF-8 and UTF-16 little- and big-endian.
Using this is pretty simple.
use relision::decoder; fn main() { // Copy the standard in to the standard out, one character at a time. let mut source = std::io::stdin(); let decode = decoder::Decode::with_capacity(&mut source, 16); for ch in decode { println!("{}", ch); } }