unicode_names2 2.0.0

Map characters to and from their name given in the Unicode standard. This goes to great lengths to be as efficient as possible in both time and space, with the full bidirectional tables weighing barely 500 KB but still offering O(1)* look-up in both directions. (*more precisely, O(length of name).)
Documentation
use std::{env, path::PathBuf};
use unicode_names2_generator as generator;

/// [UnicodeData.txt] contains Unicode Character Data
///
/// [UnicodeData.txt]: https://www.unicode.org/Public/16.0.0/ucd/UnicodeData.txt
const UNICODE_DATA: &str = include_str!("data/UnicodeData.txt");
/// Unicode aliases
///
/// [NamesList.txt] contents contains a map of unicode aliases to their corresponding values.
///
/// [NamesList.txt]: https://www.unicode.org/Public/16.0.0/ucd/NameAliases.txt
const NAME_ALIASES: &str = include_str!("data/NameAliases.txt");

fn main() {
    println!("cargo:rerun-if-changed=build.rs");
    println!("cargo:rerun-if-changed=data/");
    let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
    {
        let mut generated_path = out_dir.clone();
        generated_path.push("generated.rs");
        generator::generate(UNICODE_DATA, Some(&generated_path), None);
    }
    {
        let mut generated_phf_path = out_dir.clone();
        generated_phf_path.push("generated_phf.rs");
        generator::generate_phf(UNICODE_DATA, Some(&generated_phf_path), None, 3, 2);
    }
    {
        let mut generated_alias_path = out_dir;
        generated_alias_path.push("generated_alias.rs");
        generator::generate_aliases(NAME_ALIASES, &generated_alias_path);
    }
}