Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incorrect restriction levels for ascii strings #25

@sunfishcode

Description

@sunfishcode

unicode-security's RestrictionLevelDetection seems to detect an ASCII "a" as SingleScript rather than ASCIIOnly.

It also seems to detect a Cyrillic "а" as AsciiOnly rather than SingleScript.

Specifically, this program:

use unicode_security::restriction_level::RestrictionLevelDetection;

fn main() {
    for string in &[
        "\u{61}",
        "\u{430}",
    ] {
        println!("{} ({}): {:?}",
            string.escape_unicode(),
            string.escape_debug(),
            string.detect_restriction_level(),
        );
    }
}

Prints this:

\u{61} (a): SingleScript
\u{430} (а): ASCIIOnly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions