#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 44946/week @ 2018-10-09 43240/week @ 2018-10-16 49397/week @ 2018-10-23 48032/week @ 2018-10-30 48958/week @ 2018-11-06 49080/week @ 2018-11-13 43382/week @ 2018-11-20 48774/week @ 2018-11-27 52510/week @ 2018-12-04 54657/week @ 2018-12-11 48698/week @ 2018-12-18 36514/week @ 2018-12-25 47663/week @ 2019-01-01 51943/week @ 2019-01-08 59820/week @ 2019-01-15

209,852 downloads per month
Used in 3,089 crates (34 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