-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[release/6.0-staging] Fix creating cultures with extensions in the name #87177
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ public partial class CompareInfo | |
| [NonSerialized] | ||
| private bool _isAsciiEqualityOrdinal; | ||
|
|
||
| private void IcuInitSortHandle() | ||
| private void IcuInitSortHandle(string interopCultureName) | ||
| { | ||
| if (GlobalizationMode.Invariant) | ||
| { | ||
|
|
@@ -23,6 +23,7 @@ private void IcuInitSortHandle() | |
| else | ||
| { | ||
| Debug.Assert(!GlobalizationMode.UseNls); | ||
| Debug.Assert(interopCultureName != null); | ||
|
|
||
| // Inline the following condition to avoid potential implementation cycles within globalization | ||
| // | ||
|
|
@@ -31,7 +32,7 @@ private void IcuInitSortHandle() | |
| _isAsciiEqualityOrdinal = _sortName.Length == 0 || | ||
| (_sortName.Length >= 2 && _sortName[0] == 'e' && _sortName[1] == 'n' && (_sortName.Length == 2 || _sortName[2] == '-')); | ||
|
|
||
| _sortHandle = SortHandleCache.GetCachedSortHandle(_sortName); | ||
| _sortHandle = SortHandleCache.GetCachedSortHandle(interopCultureName); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eiriktsarpalis this is part of the delta changes from the main changes. |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -191,7 +191,7 @@ private void InitSort(CultureInfo culture) | |
| } | ||
| else | ||
| { | ||
| IcuInitSortHandle(); | ||
| IcuInitSortHandle(culture.InteropName!); | ||
| } | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eiriktsarpalis this is part of the delta changes from the main changes. |
||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -413,6 +413,12 @@ internal sealed partial class CultureData | |
| private static volatile Dictionary<string, CultureData>? s_cachedRegions; | ||
| private static volatile Dictionary<string, string>? s_regionNames; | ||
|
|
||
| /// <summary> | ||
| /// The culture name to use to interop with the underlying native globalization libraries like ICU or Windows NLS APIs. | ||
| /// For example, we can have the name de_DE@collation=phonebook when using ICU for the German culture de-DE with the phonebook sorting behavior. | ||
| /// </summary> | ||
| internal string? InteropName => _sWindowsName; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eiriktsarpalis this is part of the delta changes from the main changes. |
||
|
|
||
| internal static CultureData? GetCultureDataForRegion(string? cultureName, bool useUserOverride) | ||
| { | ||
| // First do a shortcut for Invariant | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -580,6 +580,12 @@ public static CultureInfo[] GetCultures(CultureTypes types) | |
| /// </summary> | ||
| internal string SortName => _sortName ??= _cultureData.SortName; | ||
|
|
||
| /// <summary> | ||
| /// The culture name to use to interop with the underlying native globalization libraries like ICU or Windows NLS APIs. | ||
| /// For example, we can have the name de_DE@collation=phonebook when using ICU for the German culture de-DE with the phonebook sorting behavior. | ||
| /// </summary> | ||
| internal string? InteropName => _cultureData.InteropName; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eiriktsarpalis this is part of the delta changes from the main changes. |
||
|
|
||
| public string IetfLanguageTag => | ||
| // special case the compatibility cultures | ||
| Name switch | ||
|
|
||
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.
@eiriktsarpalis this is part of the delta changes from the main changes.