#unicode-characters #unicode #no-alloc #text

no-std unicode-properties

Query character Unicode properties according to UAX #44 and UTR #51

2 releases

0.1.1 Jan 18, 2024
0.1.0 Jul 27, 2023

#15 in No standard library

Download history 36205/week @ 2024-03-14 35168/week @ 2024-03-21 34932/week @ 2024-03-28 32160/week @ 2024-04-04 32920/week @ 2024-04-11 33969/week @ 2024-04-18 36005/week @ 2024-04-25 37302/week @ 2024-05-02 36965/week @ 2024-05-09 35407/week @ 2024-05-16 82933/week @ 2024-05-23 128713/week @ 2024-05-30 163483/week @ 2024-06-06 191600/week @ 2024-06-13 200700/week @ 2024-06-20 177154/week @ 2024-06-27

757,389 downloads per month
Used in 1,848 crates (9 directly)

MIT/Apache

290KB
3.5K SLoC

unicode-properties

Build Status Current Version License: MIT/Apache-2.0


lib.rs:

Query character Unicode properties according to Unicode Standard Annex #44 and Unicode Technical Standard #51 rules.

Currently we support the General_Category property as well as Emoji and Emoji_Component.

Future properties can be added as requested.

use unicode_properties::UnicodeEmoji;
use unicode_properties::UnicodeGeneralCategory;

fn main() {
    let ch = '🦀'; // U+1F980 CRAB
    let is_emoji = ch.is_emoji_char();
    let group = ch.general_category_group();
    println!("{}({:?})", ch, group);
    println!("The above char {} for use as emoji char.",
             if is_emoji { "is recommended" } else { "is not recommended" });
}

Features

general-category

Provides the most general classification of a character, based on its primary characteristic.

emoji

Provides the emoji character properties of a character.

No runtime deps

Features