Skip to content
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

System.Globalization.RegionInfo.CurrentRegion returns blank values on Maui #110704

Open
mmiller-d8 opened this issue Dec 13, 2024 · 4 comments
Open

Comments

@mmiller-d8
Copy link

mmiller-d8 commented Dec 13, 2024

Description

System.Globalization.RegionInfo.CurrentRegion returns a default RegionInfo object. This worked before upgrading to .net 9.

Currently, I've only tested this on iOS.

Another thing that is broken with .net 9 is my ability to compile for Android at all. There is a discrepancy with the SDK version, but that's a different issue.

This is kind of a big deal. I would assume it breaks globalization? It does certainly break the ability to show the correct currency symbol in my app. It also makes it impossible for me to get the correct pricing to display to the user.

Steps to Reproduce

  1. Create a new iOS app. Or use an existing one.
  2. Assign System.Globalization.RegionInfo.CurrentRegion to a variable.
  3. Set a breakpoint
  4. Look at the value. It's all blanks and the currency symbol is something I don't recognize.

Link to public reproduction project repository

No response

Version with bug

9.0.0 GA

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

I was not able test on other platforms

Affected platform versions

iOS 17.2 is the only one I've tested it on.

Did you find any workaround?

I did not.

Relevant log output

@PureWeen PureWeen transferred this issue from dotnet/maui Dec 13, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 13, 2024
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 Dec 13, 2024
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 Dec 13, 2024

@matouskozak could you please have a look at this one too? Thanks!

This is most likely related to the issue that the CurrentCulture is returning en no region is associated to it.

@matouskozak
Copy link
Member

matouskozak commented Dec 14, 2024

@matouskozak could you please have a look at this one too? Thanks!

This is most likely related to the issue that the CurrentCulture is returning en no region is associated to it.

I think you're right.

@mmiller-d8 Thank you for reporting the issue, a temporary workaround for you could be to set the CurrentCulture for your app using NSLocale (note: this only works on iOS). I'll try to fix this issue soon, but it will take some time until the fix makes it into servicing releases.

@matouskozak matouskozak removed the untriaged New issue has not been triaged by the area owner label Dec 14, 2024
@matouskozak matouskozak added this to the 10.0.0 milestone Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants