UTF8 Rune
Lightweight crate that aims at being a building block for libraries that work with UTF-8 data.
This crate provides the struct Rune which can thought of in some cases as a drop-in replacement to Rust's char type.
This crate also provides a few low-level tools to work with raw pointers of bytes and work with a sequence of bytes to produce valid UTF-8 data.
The idea of Rune both borrows from and expands Golang's notion of rune
such that rather than representing one 32 bits integer, each
utf8_rune::Rune represents a set of bytes that, when displayed
together represent a single visible UTF-8 character.
Examples
utf8_rune::Rune
use Rune;
let rune = new;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
utf8_rune::Runes
use Runes;
let parts = new;
assert_eq!;
use Runes;
let runes = new;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
utf8_rune::RuneParts
use ;
let parts = new;
assert_eq!;
assert_eq!;
assert_eq!;
let runes = parts.into_runes;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
utf8_rune::heuristic
use get_rune_cutoff_at_index;
let bytes = "π©π»βπππΏπ§π½βππ¨βππΆοΈπΉππ₯β€οΈβπ₯β€οΈβπ©Ή".as_bytes;
let length = bytes.len;
let ptr = bytes.as_ptr;
let index = 56;
let cutoff = get_rune_cutoff_at_index.unwrap;
assert_eq!;