unicode_reader 1.0.2

Adaptors which wrap byte-oriented readers and yield the UTF-8 data as Unicode code points or grapheme clusters.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
extern crate unicode_reader;
use unicode_reader::*;

use std::io;

fn main() {
    for (i, grapheme) in Graphemes::from(io::stdin()).enumerate() {
        let grapheme = grapheme.expect("I/O error");
        println!("{}: {} ({} code points, {} bytes)",
                i, grapheme, grapheme.chars().count(), grapheme.len());
    }
}