#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

#2 in Internationalization (i18n)

Download history 70622/week @ 2019-01-20 66102/week @ 2019-01-27 68483/week @ 2019-02-03 71738/week @ 2019-02-10 66283/week @ 2019-02-17 72730/week @ 2019-02-24 72202/week @ 2019-03-03 71492/week @ 2019-03-10 68283/week @ 2019-03-17 61865/week @ 2019-03-24 69698/week @ 2019-03-31 71510/week @ 2019-04-07 65761/week @ 2019-04-14 62052/week @ 2019-04-21 62576/week @ 2019-04-28

290,829 downloads per month
Used in 3,815 crates (41 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