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

Use Locale.ROOT for capitalizing / decapitalizing locale insensitive strings. #1092

Open
mrglavas opened this issue Nov 12, 2024 · 0 comments · May be fixed by #1094
Open

Use Locale.ROOT for capitalizing / decapitalizing locale insensitive strings. #1092

mrglavas opened this issue Nov 12, 2024 · 0 comments · May be fixed by #1094
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mrglavas
Copy link
Contributor

mrglavas commented Nov 12, 2024

To consistently obtain correct results when capitalizing / decapitalizing locale insensitive strings (such as programming language identifiers), Locale.ROOT must be specified as a parameter to String.toUpperCase() and String.toLowerCase(). This blog: https://mattryall.net/blog/the-infamous-turkish-locale-bug summarizes the problem with allowing the default locale to be used with String.toUpperCase() and String.toLowerCase(). Also see the note in the Javadoc here: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html#toUpperCase() which promotes the usage of Locale.ROOT for capitalizing locale independent strings. A user with a Turkish locale will see surprising and incorrect results with capitalizing the letter "i". The capitalization rules for other locales may also produce incorrect results.

@mrglavas mrglavas added the bug Something isn't working label Nov 12, 2024
@mrglavas mrglavas added this to the 24.0.12 milestone Nov 12, 2024
@mrglavas mrglavas self-assigned this Nov 12, 2024
@mrglavas mrglavas moved this from New Issues to In Progress in Open Liberty Developer Experience Nov 12, 2024
@mrglavas mrglavas linked a pull request Nov 12, 2024 that will close this issue
@mrglavas mrglavas moved this from In Progress to In Review in Open Liberty Developer Experience Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

1 participant