#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

12 releases

0.1.8 Jan 21, 2019
0.1.7 May 9, 2018
0.1.5 Jun 15, 2017
0.1.4 Feb 4, 2017
0.1.1 Jul 9, 2015

#3 in Internationalization (i18n)

Download history 38399/week @ 2018-12-20 39780/week @ 2018-12-27 53630/week @ 2019-01-03 53936/week @ 2019-01-10 66360/week @ 2019-01-17 67083/week @ 2019-01-24 67402/week @ 2019-01-31 71654/week @ 2019-02-07 67797/week @ 2019-02-14 69471/week @ 2019-02-21 74710/week @ 2019-02-28 71736/week @ 2019-03-07 69577/week @ 2019-03-14 64070/week @ 2019-03-21 65321/week @ 2019-03-28

209,852 downloads per month
Used in 3,343 crates (37 directly)

MIT/Apache

512KB
13K SLoC

unicode-normalization

Build Status Docs

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

This crate requires Rust 1.21+.

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

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

Dependencies