#character #block #unicode #cjk

no-std yeslogic-unicode-blocks

Functions to access and search Unicode blocks

1 unstable release

0.2.0 Oct 30, 2024

#1959 in Text processing

Download history 3/week @ 2024-12-11 22/week @ 2025-02-05 27/week @ 2025-02-12 1/week @ 2025-02-19 22/week @ 2025-02-26 7/week @ 2025-03-05 1/week @ 2025-03-12 129/week @ 2025-03-19 38/week @ 2025-03-26

179 downloads per month

MIT license

71KB
2K SLoC

yeslogic-unicode-blocks


This is fork of unicode-blocks maintained by YesLogic. Differences from upstream: updated Unicode data, script to regenerate Rust source.


This crate contains a list of all unicode blocks and provides some functions to search across them.

Examples

Given a character, determine what unicode block contains it.

assert_eq!(yeslogic_unicode_blocks::BASIC_LATIN, yeslogic_unicode_blocks::find_unicode_block('A').unwrap());

Given a unicode block, determine whether it is used in CJK.

assert!(yeslogic_unicode_blocks::is_cjk_block(yeslogic_unicode_blocks::CJK_UNIFIED_IDEOGRAPHS));

Given a character, determine whether it is in CJK.

assert!(yeslogic_unicode_blocks::is_cjk(''));

No runtime deps