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 for input() not working in some locales #4731

Merged
merged 2 commits into from
Mar 30, 2024

Conversation

Azhrei
Copy link
Member

@Azhrei Azhrei commented Mar 27, 2024

Fixes #4712

Description of the Change

There are 150+ places in the MapTool code base that are using String.to{Upper,Lower}Case() without a locale parameter. These locations are susceptible to case conversion issues for certain locales (primarily Turkish, but could arise in Espanol vs. Portuguese, for example, when sorting is being performed).

This PR fixes the input() function only. Other instances where corrections are necessary will be handled in separate PRs.

Possible Drawbacks

It's possible that a change may impact other locales as well. The changes require that the existing code be analyzed to determine if user-variable input is being provided, meaning "input that the user or MTscript author is providing that does not need to be matched against hard-coded strings."

The problem with input() was that it tried to do locale-sensitive comparisons against strings like LIST and ITEM, when they should've been locale-insensitive.

Documentation Notes

Since a bug is being fixed and the documentation should reflect the API contract, no documentation updates are required.

Release Notes

Corrected the case conversion code in the input() function to work in the Turkish locale (and possibly others).


This change is Reviewable

@Azhrei Azhrei marked this pull request as ready for review March 27, 2024 23:44
@cwisniew cwisniew added the bug label Mar 30, 2024
@cwisniew cwisniew enabled auto-merge March 30, 2024 11:31
@cwisniew cwisniew added this pull request to the merge queue Mar 30, 2024
Merged via the queue into RPTools:develop with commit a46218c Mar 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

[Bug]: input() MTscript function not working on some locale settings
2 participants