#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

26 releases

0.1.22 Sep 16, 2022
0.1.21 Jul 1, 2022
0.1.20 Jun 24, 2022
0.1.19 Jun 2, 2021
0.1.1 Jul 9, 2015

#28 in Text processing

Download history 729121/week @ 2022-08-19 734382/week @ 2022-08-26 739371/week @ 2022-09-02 754885/week @ 2022-09-09 781511/week @ 2022-09-16 826785/week @ 2022-09-23 782272/week @ 2022-09-30 835950/week @ 2022-10-07 838735/week @ 2022-10-14 817764/week @ 2022-10-21 766255/week @ 2022-10-28 845743/week @ 2022-11-04 818217/week @ 2022-11-11 752787/week @ 2022-11-18 811891/week @ 2022-11-25 689976/week @ 2022-12-02

3,215,373 downloads per month
Used in 16,288 crates (141 directly)

MIT/Apache

695KB
39K 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.22"

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