-
Notifications
You must be signed in to change notification settings - Fork 44
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
No warning for invalid locales #476
Comments
As far as I remember, ICU is quite tolerant with regards to what it accepts as a valid locale id and tries hard to fall back to something closely approximating what the user needs (as per https://unicode-org.github.io/icu/userguide/locale/ and https://unicode-org.github.io/icu/userguide/locale/resources.html) It might be a good idea to implement what you request based on what https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1Collator.html says about
|
So the above would be an instance of https://unicode-org.github.io/icu/userguide/locale/resources.html |
I wonder if it's worth warning/messagining on |
> stringi::stri_sort(c("a", "c", "ch", "h", "ą"), locale="C")
[1] "a" "ą" "c" "ch" "h"
> stringi::stri_sort(c("a", "c", "ch", "h", "ą"), locale="en")
[1] "a" "ą" "c" "ch" "h"
> stringi::stri_sort(c("a", "c", "ch", "h", "ą"), locale="pl")
[1] "a" "ą" "c" "ch" "h"
> stringi::stri_sort(c("a", "c", "ch", "h", "ą"), locale="sk")
[1] "a" "ą" "c" "h" "ch"
> stringi::stri_sort(c("a", "c", "ch", "h", "ą"), locale="unknown")
[1] "a" "ą" "c" "ch" "h"
Warning message:
In stringi::stri_sort(c("a", "c", "ch", "h", "ą"), locale = "unknown") :
A resource bundle lookup returned a result either from the root or the default locale. |
Thanks! |
…ends up with ICU's returning a resource bundle from the root locale
Created on 2022-04-14 by the reprex package (v2.0.1)
Originally filed in tidyverse/stringr#440
The text was updated successfully, but these errors were encountered: