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

Fix wrong capital sharp S (ß, U+00DF) #348

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Sogolumbo
Copy link

@Sogolumbo Sogolumbo commented Apr 7, 2022

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.

The java function String.toUpperCase() converts the sharp S (ß, U+00DF) into 'SS' instead of ẞ (U+1E9E). That's wrong.
@Sogolumbo
Copy link
Author

I wasn't able to test this code because I have no working setup for Android App building.

@rkkr
Copy link
Owner

rkkr commented Apr 12, 2022

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"){
Copy link
Owner

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.

Copy link
Author

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.

@Sogolumbo
Copy link
Author

Sogolumbo commented Apr 25, 2022

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.

Yep in theory it's easy. But when I open the folder in Android Studio I get an error:

Unable to find method 'org.gradle.api.artifacts.result.ComponentSelectionReason.getDescription()Ljava/lang/String;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

The recommended fixes don't work for me.
I don't know anything about gradle and I don't have the time at hand to dive into it.

Make decisions based on the correct input instead of the corrupted output.
@rkkr
Copy link
Owner

rkkr commented May 1, 2022

image

\u1E9E is not available in older Android version. So an SDK version check is needed for version since when it's included (probably Android 6). Sending a message with ẞ to someone running older Android (and likely Windows) will result in them getting a ☐.
The code also doesn't compile.

@Sogolumbo
Copy link
Author

I fixed the syntax.

What happens on older SDK versions?
Is it still possible to type the letter? And is the letter encoded correctly (If I send the text to a person with higher SDK will they see the right character)?

Which kind of workaround would you deem appropriate?
Would you like to show SS instead? Or show the non-capital character (ß, U+00DF)?

If a person would like to writeSS instead of (U+1E9E) they will most likely type S two times (because that's the quickest way).
If they want to use (U+1E9E) but can't find it they will think that it's not available (which it isn't) and probably be fine.

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

Successfully merging this pull request may close these issues.

2 participants