-
Notifications
You must be signed in to change notification settings - Fork 229
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
Fix wrong capital sharp S (ß, U+00DF) #348
base: master
Are you sure you want to change the base?
Conversation
The java function String.toUpperCase() converts the sharp S (ß, U+00DF) into 'SS' instead of ẞ (U+1E9E). That's wrong.
I wasn't able to test this code because I have no working setup for Android App building. |
Setting up build environment is easy. All you need is Android Studio. This project has no dependencies and no native code so no extras are needed. |
@@ -244,7 +244,12 @@ public static String toTitleCaseOfKeyLabel(final String label, | |||
if (label == null) { | |||
return label; | |||
} | |||
return label.toUpperCase(getLocaleUsedForToTitleCase(locale)); | |||
titleCaseLabel = label.toUpperCase(getLocaleUsedForToTitleCase(locale)) | |||
if (titleCaseLabel == "SS"){ |
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.
Don't try to remedy a corrupt data, but convert properly instead. If an actual SS
will ever appear it will be fun to find where ẞ
came from.
Add a switch
statement on label
and default
to label.toUpperCase
.
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.
Thanks for this hint. I fixed it in 20529e8
.
Yep in theory it's easy. But when I open the folder in Android Studio I get an error:
The recommended fixes don't work for me. |
Make decisions based on the correct input instead of the corrupted output.
I fixed the syntax. What happens on older SDK versions? Which kind of workaround would you deem appropriate? If a person would like to write |
The java function String.toUpperCase() converts the sharp S (ß, U+00DF) into 'SS' instead of ẞ (U+1E9E). That's wrong, I fixed it.
Fixes on of the issues mentioned in #254.