-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[browser][non-icu] HybridGlobalization
SortKey
#84621
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsImplements a chunk of web-api based globalization. Is a part of HybridGlobalization feature and contributes to #79989. Old, icu-based private API: New, non-icu private API: none, Web API does not expose SortKey. We throw PlatformNotSupportedException. Affected public API (see: tests in CompareInfoTests.cs):
All changes in behavior are listed in docs\design\features\hybrid-globalization.md This PR also refactors CompareInfo tests - it moves common properties/fields to cc @SamMonoRT
|
Tagging subscribers to this area: @dotnet/area-system-globalization Issue DetailsImplements a chunk of web-api based globalization. Is a part of HybridGlobalization feature and contributes to #79989. Old, icu-based private API: New, non-icu private API: none, Web API does not expose SortKey. We throw PlatformNotSupportedException. Affected public API (see: tests in CompareInfoTests.cs):
All changes in behavior are listed in docs\design\features\hybrid-globalization.md This PR also refactors CompareInfo tests - it moves common properties/fields to cc @SamMonoRT
|
What are the size wins ? |
Size win: Use-cases (only of changes from this PR, not the whole collation):
|
Thanks
I mean what are the use-cases where those APIs are useful ? This is what I tried https://github.com/search?q=CompareInfo.GetSortKey+lang%3AC%23+&type=code&p=3 Would it be better if we provide bitwise/invariant sortkey instead of PNSE ? Just an idea. |
Sorry, I did not get it. It seems you are right, mostly DBs.
It is not a bad idea but I think if we make it a rule for all locales, it could be confusing. User that calls e.g.
I will stash this idea in the tracking issue in case there is a demand on the above case. |
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.
LGMT
What is our plan for Android/iOS where maybe Hybrid could support these methods ?
@@ -1599,5 +1615,9 @@ public SortVersion Version | |||
} | |||
|
|||
public int LCID => CultureInfo.GetCultureInfo(Name).LCID; | |||
|
|||
#if TARGET_BROWSER | |||
private static string GetPNSEText(string funcName) => $"{funcName} is not supported when HybridGlobalization=true. Disable it to load larger ICU bundle, then use this option."; |
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.
Should this be in resource file and localized ?
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.
Good idea, I can see all exception text in PrivateCoreLib are stored like this, so you are right.
Android might have an invariant equivalent, it's dedicated for LDAP sorting: https://docs.oracle.com/javase/7/docs/api/javax/naming/ldap/SortKey.html. I do not see any culture-related SortKey. |
Implements a chunk of web-api based globalization. Is a part of HybridGlobalization feature and contributes to #79989.
Old, icu-based private API:
GlobalizationNative_GetSortKey
New, non-icu private API: none, Web API does not expose SortKey. We throw PlatformNotSupportedException.
Affected public API (see: tests in CompareInfoTests.cs):
All changes in behavior are listed in docs\design\features\hybrid-globalization.md
This PR also refactors CompareInfo tests - it moves common properties/fields to
CompareInfoTestsBase
.cc @SamMonoRT