gecko-dev/third_party/rust/unicode-normalization
Manish Goregaokar 9889db29ed Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted
MozReview-Commit-ID: FVn6c6ol36V
2016-10-28 16:34:19 -07:00
..
scripts Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
src Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
.cargo-checksum.json Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
.cargo-ok Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
.gitignore Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
.travis.yml Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
COPYRIGHT Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
Cargo.toml Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
LICENSE-APACHE Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
LICENSE-MIT Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00
README.md Bug 1151899 - Vendor rust-url-capi deps; r=valentin,ted 2016-10-28 16:34:19 -07:00

README.md

Unicode character composition and decomposition utilities as described in Unicode Standard Annex #15.

Build Status

Documentation

extern crate unicode_normalization;

use unicode_normalization::char::compose;
use unicode_normalization::UnicodeNormalization;

fn main() {
    assert_eq!(compose('A','\u{30a}'), Some('Å'));
    
    let s = "ÅΩ";
    let c = s.nfc().collect::<String>();
    assert_eq!(c, "ÅΩ");
}

crates.io

You can use this package in your project by adding the following to your Cargo.toml:

[dependencies]
unicode-normalization = "0.1.1"