-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[iOS] Implement IgnoreSymbols for CompreInfo in managed code #120462
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
[iOS] Implement IgnoreSymbols for CompreInfo in managed code #120462
Conversation
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.iOS.cs
Show resolved
Hide resolved
/azp run runtime-ioslike |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
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.
Pull Request Overview
This PR implements support for the CompareOptions.IgnoreSymbols
option in CompareInfo operations on iOS using hybrid globalization. Previously, this option was not supported on Apple platforms and would throw exceptions.
- Adds native implementation for symbol filtering in managed code for iOS
- Updates test cases to enable IgnoreSymbols tests on Apple platforms
- Modifies native enum definition to use explicit types and hex values
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/native/libs/System.Globalization.Native/pal_collation.m | Updates enum definition to use explicit int32_t type and hex values |
src/libraries/System.Runtime/tests/System.Globalization.Tests/CompareInfo/*.cs | Removes platform-specific test exclusions and adds comprehensive IgnoreSymbols test cases |
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.iOS.cs | Implements IgnoreSymbols functionality with symbol filtering buffer and character categorization |
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Icu.cs | Updates method signatures to use ReadOnlySpan parameters instead of raw pointers |
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.iOS.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.iOS.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.iOS.cs
Show resolved
Hide resolved
/azp run runtime-maccatalyst,runtime-ioslikesimulator |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-maccatalyst |
No pipelines are associated with this pull request. |
/azp run runtime-maccatalyst |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-ioslike |
Azure Pipelines successfully started running 1 pipeline(s). |
The failures on Apple mobile are unrelated to this PR and are already known. |
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.iOS.cs
Show resolved
Hide resolved
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.
Added one comment/question. LGTM otherwise.
Supersedes #118523.
Implementation of
CompareOptions.IgnoreSymbols
forIndexOf
,IsPrefix
,IsSuffix
,Compare
on iOS. Because ObjectiveC string APIs (https://developer.apple.com/documentation/foundation/nsstring/compareoptions?language=objc) don't provide a direct alternative toIgnoreSymbols
option, we filter the symbols from the strings in the managed code and after returning from native, we re-calculate the original index and length.The implementation works in a following:
Fixes #111895