#unicode-characters #unicode #character-property #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

#12 in No standard library

Download history 16997/week @ 2023-12-19 13901/week @ 2023-12-26 19634/week @ 2024-01-02 21626/week @ 2024-01-09 26067/week @ 2024-01-16 24682/week @ 2024-01-23 33504/week @ 2024-01-30 36372/week @ 2024-02-06 40451/week @ 2024-02-13 40803/week @ 2024-02-20 37002/week @ 2024-02-27 38786/week @ 2024-03-05 37223/week @ 2024-03-12 35102/week @ 2024-03-19 34737/week @ 2024-03-26 28299/week @ 2024-04-02

140,967 downloads per month
Used in 166 crates (5 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