fix(android): uppercase conversion in getEnumName() method#3311
Merged
mfazekas merged 4 commits intornmapbox:mainfrom Jan 12, 2024
Merged
fix(android): uppercase conversion in getEnumName() method#3311mfazekas merged 4 commits intornmapbox:mainfrom
mfazekas merged 4 commits intornmapbox:mainfrom
Conversation
Fixed a bug affecting locales such as Turkish, where lowercase 'i' was incorrectly converted to 'İ' instead of 'I'. Now, the US locale is explicitly used for enum name conversion to ensure correct character mapping.
Contributor
|
Amazing! Thanks much! |
Contributor
Author
|
@mfazekas, could you please provide an estimated timeline for when you expect the merge to be completed? |
mfazekas
reviewed
Jan 11, 2024
|
|
||
| fun getEnumName(): String { | ||
| return mPayload!!.getString("value")!!.toUpperCase().replace("-", "_") | ||
| return mPayload!!.getString("value")!!.uppercase(Locale.US).replace("-", "_") |
Contributor
There was a problem hiding this comment.
I think ‘uppercase()’ without locale param should work.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/uppercase.html
What do you think?
Contributor
Author
There was a problem hiding this comment.
You are right :). If you don't mind I have set up Kotlin unit testing in the project, I have added a unit test for that to be sure.
Contributor
Let a note on the change, then it can be merged |
there are only tests for the getEnumName method for now
1525253 to
9599737
Compare
mfazekas
approved these changes
Jan 12, 2024
Contributor
|
Hi @mfazekas , when do you plan to create a release with this fix, please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixed a bug affecting locales such as
Turkish, where lowercase 'i' was incorrectly converted to 'İ' instead of 'I'. Now, the US locale is explicitly used for enum name conversion to ensure correct character mapping.
Fixes #3255
Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)