#range #unicode #string-representation #convert-string #parser #points #vice

unicode-range

UnicodeRange is a Rust library for parsing and stringifying Unicode ranges. It provides functionality to convert a string representation of Unicode ranges into a vector of code points and vice versa.

1 unstable release

new 0.1.0 Dec 6, 2024

#1236 in Algorithms

Download history 110/week @ 2024-12-02

110 downloads per month
Used in cn-font-split

Apache-2.0

7KB
117 lines

UnicodeRange

UnicodeRange is a Rust library for parsing and stringifying Unicode ranges. It provides functionality to convert a string representation of Unicode ranges into a vector of code points and vice versa.

Usage

use unicode_range::UnicodeRange;

fn main() {
    let input = "U+0-7F,U+007F-00FF,U+4??,U+ff65";
    let code_points = UnicodeRange::parse(input);
    println!("{:?}", code_points);

    let stringified = UnicodeRange::stringify(&code_points);
    println!("{}", stringified);
}

No runtime deps