Uh oh!
There was an error while loading. Please reload this page.
[release/9.0-staging][iOS][globalization] Fix IndexOf on empty strings on iOS to return -1 - #112012
Conversation
matouskozak
commented
Jan 30, 2025
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
jeffschwMSFT
left a comment
There was a problem hiding this comment.
lgtm. we will take for consideration in 9.0.x
matouskozak
commented
Feb 4, 2025
/ba -g the timeout on CoreCLR Windows x64 Debug is not related to this change |
matouskozak
commented
Feb 11, 2025
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
I had to disable the newly added test for wasm hybrid globalization due to an incorrect output 551ba2e (fyi: @ilonatommy) Rerunning the CI to confirm there is nothing else related. @jeffschwMSFT |
matouskozak
commented
Feb 11, 2025
The timeouts on |
matouskozak
commented
Feb 12, 2025
The |
matouskozak
commented
Feb 13, 2025
/ba-g timeouts are not related to this PR |
Manual backport of #111898.
Fix incorrect return condition for iOS IndexOf implementation and add test case for
IndexOf("", <something>)and"".Contains(<something>). Clean-up of some styling issues and adding comments.Customer Impact
Customers using
CompareInfo.IndexOforstring.ContainsAPIs on empty source strings involving ICU logic are returning a result 0 (indicates found at index 0) instead of -1 (indicates not found).Some of the issues reported by customers:
Regression
The regression was introduced in #86895 and initially limited to when hybrid globalization is enabled. However, in .NET 9, we switched fully to Apple native globalization APIs (initially also referred to as hybrid globalization), thus spreading this issue to all iOS Globalization code using the IndexOf API.
Testing
Previously there were no test cases for this code path. This PR adds test scenarios for both
CompareInfo.IndexOforstring.Contains.Risk
Low
This change is correcting previously incorrect behavior. It is unlikely that .NET 9 iOS customers are depending on this new behavior as it is fundamentally incorrect as per .net doc.