#text #unicode #normalization #decomposition #recomposition

unicode-normalization

This crate provides functions for normalization of Unicode strings, including Canonical and Compatible Decomposition and Recomposition, as described in Unicode Standard Annex #15

10 releases

0.1.6 May 2, 2018
0.1.5 Jun 15, 2017
0.1.4 Feb 4, 2017
0.1.3 Dec 19, 2016
0.0.3 Apr 15, 2015

#6 in Text processing

Download history 36548/week @ 2018-09-19 41489/week @ 2018-09-26 43375/week @ 2018-10-03 43990/week @ 2018-10-10 46488/week @ 2018-10-17 42263/week @ 2018-10-24 50154/week @ 2018-10-31 47752/week @ 2018-11-07 50112/week @ 2018-11-14 48038/week @ 2018-11-21 43668/week @ 2018-11-28 48975/week @ 2018-12-05 47433/week @ 2018-12-12

125,250 downloads per month
Used in 2,850 crates (34 directly)

MIT/Apache

4.5MB
143K SLoC

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.7"

lib.rs:

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

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.7"

No runtime deps