#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

#15 in Text processing

Download history 63288/week @ 2019-04-25 61822/week @ 2019-05-02 71602/week @ 2019-05-09 70820/week @ 2019-05-16 72176/week @ 2019-05-23 77598/week @ 2019-05-30 79505/week @ 2019-06-06 82350/week @ 2019-06-13 78121/week @ 2019-06-20 73838/week @ 2019-06-27 67347/week @ 2019-07-04 75490/week @ 2019-07-11 79154/week @ 2019-07-18 81648/week @ 2019-07-25 82860/week @ 2019-08-01

290,829 downloads per month
Used in 4,156 crates (43 directly)

MIT/Apache

515KB
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