Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[iOS] Using CompareOptions.IgnoreSymbols throws an exception in .net 9 #115304

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

Open
claytonone opened this issue May 4, 2025 · 5 comments
Open
Assignees
Labels
area-System.Globalization os-ios Apple iOS untriaged New issue has not been triaged by the area owner

Comments

@claytonone
Copy link

claytonone commented May 4, 2025

Description

Attempting to call CultureInfo.InvariantCulture.CompareInfo.IndexOf with CompareOptions.IgnoreSymbols throws a PlatformNotSupportedException (see log output below for full message) on iOS but works fine for Android. This used to work fine in .net 8 MAUI.

CultureInfo.InvariantCulture.CompareInfo.IndexOf("string 1", "strng 2", CompareOptions.IgnoreSymbols) >= 0;

The exception talks about disabling HybridGlobalization but I cannot find any documentation about this for MAUI.

Steps to Reproduce

  1. Attempt to call CultureInfo.InvariantCulture.CompareInfo.IndexOf with CompareOptions.IgnoreSymbols
  2. Note that it throws an exception on iOS

Link to public reproduction project repository

No response

Version with bug

9.0.60 SR6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.100 SR10

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

Exception has occurred: CLR/System.Reflection.TargetInvocationException
An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in Microsoft.iOS.dll: 'Exception has been thrown by the target of an invocation.'
 Inner exceptions found, see $exception in variables window for more details.
 Innermost exception 	 System.PlatformNotSupportedException : CompareOptions = IgnoreCase, IgnoreNonSpace, IgnoreSymbols are not supported when HybridGlobalization=true on this platform. Disable it to load larger ICU bundle, then use this option.
@kubaflo
Copy link

kubaflo commented May 4, 2025

It seems to be related #109623

@deepika2509
Copy link

This issue has been verified in Visual Studio Code (1.99.3) with MAUI versions (9.0.60 , 9.0.0 & 8.0.100). It can be reproduced on iOS platform in 9.0.60 & 9.0.0 and not reproduced on 8.0.100 and Android platforms

@PureWeen PureWeen transferred this issue from dotnet/maui May 5, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label May 5, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

@tarekgh tarekgh added the os-ios Apple iOS label May 5, 2025
Copy link
Contributor

Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

@tarekgh
Copy link
Member

tarekgh commented May 5, 2025

@matouskozak please triage. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Globalization os-ios Apple iOS untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

5 participants