-
Notifications
You must be signed in to change notification settings - Fork 429
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
Adding locale fix for turkey locale issue when lowercasing an "i" #384
Conversation
@peterbae, |
Codecov Report
@@ Coverage Diff @@
## dev #384 +/- ##
============================================
+ Coverage 40.16% 40.18% +0.02%
- Complexity 1892 1894 +2
============================================
Files 107 107
Lines 24482 24481 -1
Branches 4038 4038
============================================
+ Hits 9833 9838 +5
+ Misses 12815 12800 -15
- Partials 1834 1843 +9
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few Suggestions:
- Instead of using direct "".toLowerCase you can add new wrapper function(s) in StringUtil class. If locale is null then will use current default implementations.
Hi Nikhil, thanks for the suggestion. I think providing a wrapper function for toLowerCase() and adding more locale flexibility is a good idea, but currently we only want to explicitly use English as our locale to avoid case conversion problems, and I think this change solves that problem. I'll come back to that feature later when it becomes necessary. |
using toLowerCase() without any locale makes it implicitly toLowerCase(Locale.getDefault()). This is fine in most counties but in Turkey, the default locale converts uppercase "I" to a dotless "i", which is not the same as the lowercase "i" in English. Passing Locale.ENGLISH (or Locale.US) in toLowerCase() solves this problem. I have made these changes to all the applicable places in the codebase.
Fixes issue #381