Iniital import of unicode-normalization v0.1.16 am: 12bf0863fe am: 1721046199 am: 4dc50db10c

Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/unicode-normalization/+/1533349

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibc6773fc391d4f0f4c716f753fca00681e27fb02
tree: 0136cc345fed635d4e2e2570df21987703f9b8fd
  1. benches/
  2. scripts/
  3. src/
  4. .cargo_vcs_info.json
  5. .gitignore
  6. .travis.yml
  7. Cargo.toml
  8. Cargo.toml.orig
  9. COPYRIGHT
  10. LICENSE-APACHE
  11. LICENSE-MIT
  12. METADATA
  13. MODULE_LICENSE_APACHE2
  14. OWNERS
  15. README.md
README.md

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.