#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

20 releases

0.1.16 Nov 18, 2020
0.1.13 Jun 16, 2020
0.1.12 Jan 21, 2020
0.1.11 Nov 22, 2019
0.1.1 Jul 9, 2015

#43 in Text processing

Download history 215752/week @ 2020-09-25 226284/week @ 2020-10-02 234294/week @ 2020-10-09 229037/week @ 2020-10-16 239783/week @ 2020-10-23 230741/week @ 2020-10-30 235855/week @ 2020-11-06 267605/week @ 2020-11-13 264784/week @ 2020-11-20 254618/week @ 2020-11-27 261318/week @ 2020-12-04 247282/week @ 2020-12-11 214026/week @ 2020-12-18 170508/week @ 2020-12-25 241883/week @ 2021-01-01 264988/week @ 2021-01-08

944,664 downloads per month
Used in 7,822 crates (80 directly)

MIT/Apache

505KB
25K 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.16"

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