#unicode #plugin #unicode-characters #text

nightly unicode_names_macros

Support macros for unicode_names

6 releases

Uses old Rust 2015

0.1.5 Apr 8, 2015
0.1.4 Jan 30, 2015
0.1.1 Dec 30, 2014
0.1.0 Nov 14, 2014

#104 in #unicode-characters

Download history 1/week @ 2024-02-23 2/week @ 2024-03-01 73/week @ 2024-03-29

73 downloads per month
Used in unicode_names

MIT/Apache

3KB
53 lines

unicode_names

Build Status Coverage Status

Time and memory efficiently mapping characters to and from their Unicode 7.0 names, at runtime and compile-time.

extern crate unicode_names;

fn main() {
    println!("☃ is called {}", unicode_names::name('')); // SNOWMAN
    println!("{} is happy", unicode_names::character("white smiling face")); //
    // (NB. case insensitivity)
}

The maps are compressed using similar tricks to Python's unicodedata module, although those here are about 70KB (12%) smaller.

Documentation


lib.rs:

A macro that maps unicode names to chars and strings.

Dependencies

~3.5MB
~75K SLoC