[iOS] Implement IgnoreSymbols for CompreInfo in managed code#120462
Conversation
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-ioslike |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
There was a problem hiding this comment.
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 |
|
/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. |
tarekgh
left a comment
There was a problem hiding this comment.
Added one comment/question. LGTM otherwise.
Supersedes #118523.
Implementation of
CompareOptions.IgnoreSymbolsforIndexOf,IsPrefix,IsSuffix,Compareon iOS. Because ObjectiveC string APIs (https://developer.apple.com/documentation/foundation/nsstring/compareoptions?language=objc) don't provide a direct alternative toIgnoreSymbolsoption, 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