#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 31572/week @ 2018-06-12 36155/week @ 2018-06-19 37074/week @ 2018-06-26 37300/week @ 2018-07-03 36172/week @ 2018-07-10 39118/week @ 2018-07-17 39974/week @ 2018-07-24 35795/week @ 2018-07-31 39715/week @ 2018-08-07 38097/week @ 2018-08-14 36445/week @ 2018-08-21 37933/week @ 2018-08-28 35204/week @ 2018-09-04

125,250 downloads per month
Used in 2,642 crates (33 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