-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix Culture creation regression when using invalid names on Windows #57754
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
Conversation
|
Tagging subscribers to this area: @tarekgh, @safern Issue DetailsFixes #57310 This change is fixing a regression from .NET 5.0. The problem happens when trying to create a CultureInfo object using culture names that Windows don't allow.
|
|
@ericstj @jeffhandley just FYI. this is a fix I am going to port to rc2 when it is ready. OfCourse, will loop you on the porting PR at that time. |
src/libraries/System.Private.CoreLib/src/System/Globalization/IcuLocaleData.cs
Show resolved
Hide resolved
eerhardt
left a comment
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.
LGTM
|
/backport to release/6.0 |
|
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1151573976 |
#57310
This change is fixing a regression from .NET 5.0. The problem happens when trying to create a CultureInfo object using culture names that Windows don't allow.
This regression occurred during the code refactoring work done to optimize the globalization data size and WASM support.
Although this fix is addressing the regression, it fixes another issue I have discovered during the investigation. Here is what the change is doing:
CultureData.Windows.cs, the conditionShouldUseUserOverrideNlsDatais wrong to use. The reason is this part of the code is not concerned about the user overrides. Even the user overrides flag is not initialized yet at this stage.GetLocaleInfoExthat help validate the culture name. That is what we have done in .NET 5.0 too.IcuLocaleData.cs, there was a bug that caused not finding the proper culture name mapping to our data because the culture name containing characters like underscore character_.