#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

23 releases

0.1.19 Jun 2, 2021
0.1.17 Feb 9, 2021
0.1.16 Nov 18, 2020
0.1.13 Jun 16, 2020
0.1.1 Jul 9, 2015

#24 in Text processing

Download history 355796/week @ 2021-07-01 359928/week @ 2021-07-08 368079/week @ 2021-07-15 352800/week @ 2021-07-22 399345/week @ 2021-07-29 386249/week @ 2021-08-05 427269/week @ 2021-08-12 419475/week @ 2021-08-19 406683/week @ 2021-08-26 374803/week @ 2021-09-02 439144/week @ 2021-09-09 440410/week @ 2021-09-16 425295/week @ 2021-09-23 444758/week @ 2021-09-30 487408/week @ 2021-10-07 425923/week @ 2021-10-14

1,444,688 downloads per month
Used in 10,378 crates (104 directly)

MIT/Apache

585KB
27K 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.19"

no_std + alloc support

This crate is completely no_std + alloc compatible. This can be enabled by disabling the std feature, i.e. specifying default-features = false for this crate on your Cargo.toml.

Dependencies