Skip to content

Use correct case folding for case insensitive match #342

@Geal

Description

@Geal

the current code of Compare::compare_no_case for &str does a to_lowercase on the input and the tag to compare to. This does not take into account complex cases when doing an uppercase or lowercase on an UTF-8 string.

The caseless crate provides methods to do caseless comparisons.

Things to check for:

  • if the input is not large enough, we do a partial match on a prefix. But the prefix should not be obtained before matching since the length before and after case folding
  • once the match is done, how to convert the size to before case folding, since a sub slice must be calculated
  • put that version behind a compiler flag?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions