Grapheme Utils
Robust Grapheme Utils to make working with Extended Grapheme Clusters nearly as easy as working with Ascii only strings. See Async-Editor an example of a Grapheme enabled editor.
What is this?
Grapheme Utils are a collection of handy utilities to make working with Extended Grapheme Clusters, measuring character widths, and examining the previous, current or next grapheme cluster or string index as straight-forward as possible.
Note: Ease of use over Ideomatic Rust
This code will return a "" grapheme or an index past the end of the string instead of None. Instead of testing for None, test for .len() == 0 for example.
Note: This code is very forgiving, and handles any index values that hits any part of a grapheme cluster as though it pointed at the beginning.
Note: This crate has not been tested with any of the very special unicode Utf-8 modes like reverse or downward text.
Example Usage
use grapheme-GraphemeUtils;
Features
- Easy to Use: This crate as been designed to be as easy to use as possible.
- Robust and Forgiving: This crate accepts any index value without panicing.
Installation
Add grapheme-utils to your Cargo.toml:
[]
= "0.1"
Then, include it in your Rust project:
use *;