Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theoretical issue with caseless comparissons #11

Open
ghost opened this issue Jul 22, 2021 · 1 comment
Open

theoretical issue with caseless comparissons #11

ghost opened this issue Jul 22, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Jul 22, 2021

It seems the spec resorts to lowercasing given strings in order to compare them ASCII case‐insensitively, but I don’t think that’s quite right.

Even though the strings being compared against are ASCII‐only, the given strings (input) are not, and that leaves ambiguity about how to handle the lowercasing for non‐ASCII code points.

Note that this is only a theoretical issue, since standard Unicode case mapping never maps to an ASCII‐only string when lowercasing (it does when uppercasing, though, e.g. uppercase "wß:" = "WSS:"), but I think Unicode doesn’t enforce case mapping strictly, so implementations might choose to implement locale‐specific mappings that may, so e.g. locale-lowercase "FİLE:" might equal "file:" (though I don’t think it does in many localized mapping implementations, if any).

I think a more succinct approach could be to establish an ASCII case‐insensitive comparison equivalence relation with an operator associated with it and use it instead.

@alwinb
Copy link
Owner

alwinb commented Jul 23, 2021

I know, this is one of these things where I just didn't bother to be more exact. Yet, at least. It's quite nice that people then notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant