Fix for input() not working in some locales #4731
Merged
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.
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 likeLIST
andITEM
, 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