-
-
Notifications
You must be signed in to change notification settings - Fork 847
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(android): uppercase conversion in getEnumName() method #3311
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.
Amazing! Thanks much! |
@mfazekas, could you please provide an estimated timeline for when you expect the merge to be completed? |
@@ -40,7 +40,7 @@ class RNMBXStyleValue(config: ReadableMap) { | |||
} | |||
|
|||
fun getEnumName(): String { | |||
return mPayload!!.getString("value")!!.toUpperCase().replace("-", "_") | |||
return mPayload!!.getString("value")!!.uppercase(Locale.US).replace("-", "_") |
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.
I think ‘uppercase()’ without locale param should work.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/uppercase.html
What do you think?
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.
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.
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
Hi @mfazekas , when do you plan to create a release with this fix, please? |
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.md
yarn generate
in the root folder/example
app./example
)