#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

13 releases

0.1.9 Nov 6, 2019
0.1.8 Jan 21, 2019
0.1.7 May 9, 2018
0.1.5 Jun 15, 2017
0.1.1 Jul 9, 2015

#10 in Text processing

Download history 82564/week @ 2019-07-24 81700/week @ 2019-07-31 88192/week @ 2019-08-07 89799/week @ 2019-08-14 82299/week @ 2019-08-21 80150/week @ 2019-08-28 93117/week @ 2019-09-04 86010/week @ 2019-09-11 92377/week @ 2019-09-18 99755/week @ 2019-09-25 107497/week @ 2019-10-02 104061/week @ 2019-10-09 108178/week @ 2019-10-16 113156/week @ 2019-10-23 100556/week @ 2019-10-30

411,002 downloads per month
Used in 4,302 crates (48 directly)

MIT/Apache

490KB
24K 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