chris-ha458 / unicode_names2

char <-> Unicode character name (maintained fork of huonw/unicode_names)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unicode_names2

Build Status

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

fn main() {
    println!("☃ is called {}", unicode_names2::name('☃')); // SNOWMAN
    println!("{} is happy", unicode_names2::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

About

char <-> Unicode character name (maintained fork of huonw/unicode_names)

License:Apache License 2.0


Languages

Language:Rust 88.1%Language:Python 11.8%Language:Makefile 0.1%