Uh oh!
There was an error while loading. Please reload this page.
Limit PNSE by using Invariant HashCode in HybridGlobalization - #96354
Conversation
ghost
commented
Dec 29, 2023
Tagging subscribers to this area: @dotnet/area-system-globalization Issue DetailsFixes #95921.
|
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Azure Pipelines successfully started running 1 pipeline(s). |
…ted for non-invariant cultures only with `IgnoreCase` or `None` options.
pavelsavara
left a comment
There was a problem hiding this comment.
Thanks for patience with my feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
PNSE by using Invariant SortKey in HybridGlobalizationPNSE by using Invariant HashCode and SortKey in HybridGlobalizationPNSE by using Invariant HashCode and SortKey in HybridGlobalizationPNSE by using Invariant HashCode in HybridGlobalization|
Azure Pipelines successfully started running 1 pipeline(s). |
ilonatommy
commented
Jan 19, 2024
/azp run runtime-wasm-libtests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ilonatommy
commented
Jan 19, 2024
AOT lanes won't finish, they are generally broken. Failures are not related. |
…otnet#96354) * Unblock all tests. * SortKey is Invariant now. * Missing SortKey changes + fix HashCode. * Typo * Revert unbocking tests connected with CompareOptions PNSE. * Hashing uses Invariant mode -these tests should be skipped. * Add active issue. * feedback * Feedback * Better documentation. * Add new tests + sanitize string before invariant comparison. * Comment + more cases. * Clean CI. * Missing change for clean CI commit. * `SortKey` not supported for non-invariant cultures, `HashCode` supported for non-invariant cultures only with `IgnoreCase` or `None` options. * Feedback. * Fix build, add docs. * Feedback @matouskozak@pavelsavara * Added tests + fixed algo. * Block failing tests for a follow-up PR. * Add more details to PNSE. * Feedback - correct comment
* Moving the tests, cleaning up. * Removal. * Rename: fix build. * Fix order, apply feedback * Missing changes. * Fixed by #96354 * This test uses SortKey, should not be enabled. * Nit * These methods use `CompareOptions = IgnoreCase, IgnoreKanaType, IgnoreWidth`, should stay blocked.
Fixes paritally #95921.
We used to throw PNSE for all
HashCodefunctions. The consequence was throwing PNSE for quite a few APIs, some of them crucial and far-connected with Globalization. With this PR the following APIs do not throw PNSE always (see the update in the doc for details):JS does not expose native, locale-sensitive hashing that we could use, so we decided to utilize Invariant version of functions instead with some limitations. Invariant hashing algorithm differs from ICU hashing with not ignoring empty unicode chars (e.g. zero width joiner), the strings get cleaned from them first.
CompareOptions.None- use invariant hashing algo.CompareOptions.IgnoreCase- use JS-native toLower() and then invariant hashing algo.CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols- keep throwing PNSE, as it was without this PR.It will be documented in the HG doc, so far I did not find an example where the behavior of APIs that threw PNSE so far differs between ICU and HG because of this change.
Out of scope (for follow-up PRs):
HashCodeand performance improvementsSortKey- investigate similar change