#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

16 releases

0.1.12 Jan 21, 2020
0.1.11 Nov 22, 2019
0.1.8 Jan 21, 2019
0.1.7 May 9, 2018
0.1.1 Jul 9, 2015

#15 in Text processing

Download history 112733/week @ 2019-11-01 134023/week @ 2019-11-08 137196/week @ 2019-11-15 149363/week @ 2019-11-22 142562/week @ 2019-11-29 152666/week @ 2019-12-06 143948/week @ 2019-12-13 97412/week @ 2019-12-20 95528/week @ 2019-12-27 139884/week @ 2020-01-03 155529/week @ 2020-01-10 161333/week @ 2020-01-17 174121/week @ 2020-01-24 167946/week @ 2020-01-31 148281/week @ 2020-02-07

561,637 downloads per month
Used in 4,952 crates (60 directly)

MIT/Apache

495KB
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.36+.

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