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

RegionInfo.CurrentRegion.ISOCurrencySymbol returns XDR on iOS device #73464

Closed
chamons opened this issue Aug 5, 2022 · 11 comments
Closed

RegionInfo.CurrentRegion.ISOCurrencySymbol returns XDR on iOS device #73464

chamons opened this issue Aug 5, 2022 · 11 comments

Comments

@chamons
Copy link

chamons commented Aug 5, 2022

From @Eilon on Thu, 04 Aug 2022 18:16:47 GMT


Issue moved from dotnet/maui#9182


From @softlion on Thursday, August 4, 2022 8:37:59 AM

Description

On an iOS device set to french FR/fr, RegionInfo.CurrentRegion.ISOCurrencySymbol returns XDR instead of EUR.
This happens only on the device, not on the simulator.

Also, when using standard resource strings on a device with FR language set, the culture stays in EN as if FR was not detected.

Device: iPhone XR, iOS 15.5

image

dotnet --version
6.0.400-preview.22330.6
VS 2022 Mac Preview 17.3.0.2089
with Xamarin.iOS 15.12.0.2

Steps to Reproduce

  • Set the iPhone langage/region to FR (france)
  • Start the maiu app in debug mode
  • Observe the value of RegionInfo.CurrentRegion.ISOCurrencySymbol

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.5 device

Did you find any workaround?

no

Relevant log output

No response

Copied from original issue xamarin/xamarin-macios#15633

@chamons
Copy link
Author

chamons commented Aug 5, 2022

From @softlion on Thu, 04 Aug 2022 19:31:22 GMT

I'm using MAUI iOS, not Xamarin @Eilon
Why did you moved that here ?*

It's working perfectly fine on Xamarin. It's a migrated app.

@chamons
Copy link
Author

chamons commented Aug 5, 2022

From @GalaxiaGuy on Fri, 05 Aug 2022 13:13:24 GMT

The code for both Xamarin.iOS and .NET iOS exists in this repo.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@chamons
Copy link
Author

chamons commented Aug 5, 2022

From @chamons on Fri, 05 Aug 2022 15:18:21 GMT

So RegionInfo.CurrentRegion.ISOCurrencySymbol is a BCL API (System.Globalization) and not part of macios.

I believe https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc would be the standard way of looking this up on iOS.

@chamons
Copy link
Author

chamons commented Aug 5, 2022

From @chamons on Fri, 05 Aug 2022 15:20:11 GMT

I am going to move this issue to dotnet/runtime as they own the BCL API in question.

@ghost
Copy link

ghost commented Aug 5, 2022

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

Issue Details

From @Eilon on Thu, 04 Aug 2022 18:16:47 GMT


Issue moved from dotnet/maui#9182


From @softlion on Thursday, August 4, 2022 8:37:59 AM

Description

On an iOS device set to french FR/fr, RegionInfo.CurrentRegion.ISOCurrencySymbol returns XDR instead of EUR.
This happens only on the device, not on the simulator.

Also, when using standard resource strings on a device with FR language set, the culture stays in EN as if FR was not detected.

Device: iPhone XR, iOS 15.5

image

dotnet --version
6.0.400-preview.22330.6
VS 2022 Mac Preview 17.3.0.2089
with Xamarin.iOS 15.12.0.2

Steps to Reproduce

  • Set the iPhone langage/region to FR (france)
  • Start the maiu app in debug mode
  • Observe the value of RegionInfo.CurrentRegion.ISOCurrencySymbol

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.5 device

Did you find any workaround?

no

Relevant log output

No response

Copied from original issue xamarin/xamarin-macios#15633

Author: chamons
Assignees: -
Labels:

area-System.Globalization, untriaged

Milestone: -

@vcsjones vcsjones added the os-ios Apple iOS label Aug 5, 2022
@ghost
Copy link

ghost commented Aug 5, 2022

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

Issue Details

From @Eilon on Thu, 04 Aug 2022 18:16:47 GMT


Issue moved from dotnet/maui#9182


From @softlion on Thursday, August 4, 2022 8:37:59 AM

Description

On an iOS device set to french FR/fr, RegionInfo.CurrentRegion.ISOCurrencySymbol returns XDR instead of EUR.
This happens only on the device, not on the simulator.

Also, when using standard resource strings on a device with FR language set, the culture stays in EN as if FR was not detected.

Device: iPhone XR, iOS 15.5

image

dotnet --version
6.0.400-preview.22330.6
VS 2022 Mac Preview 17.3.0.2089
with Xamarin.iOS 15.12.0.2

Steps to Reproduce

  • Set the iPhone langage/region to FR (france)
  • Start the maiu app in debug mode
  • Observe the value of RegionInfo.CurrentRegion.ISOCurrencySymbol

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.5 device

Did you find any workaround?

no

Relevant log output

No response

Copied from original issue xamarin/xamarin-macios#15633

Author: chamons
Assignees: -
Labels:

area-System.Globalization, untriaged, os-ios

Milestone: -

@tarekgh
Copy link
Member

tarekgh commented Aug 5, 2022

@steveisok could you please triage this one? Thanks!

@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Aug 5, 2022
@steveisok steveisok added this to the 8.0.0 milestone Aug 5, 2022
@steveisok
Copy link
Member

Similar to #70028. This is something we will address in .NET 8.

@softlion
Copy link

softlion commented Aug 6, 2022

Workaround. I still don't understand why it needs 2 releases ...
It was working in Xamarin.

No workaround needed for Android. It just works as expected.

        public static string LocaleCurrency =>
#if IOS
            Foundation.NSLocale.CurrentLocale.CurrencyCode;
#else
            RegionInfo.CurrentRegion.ISOCurrencySymbol;
#endif

@akoeplinger
Copy link
Member

This is the same issue as mentioned in #73512 (comment)

It was fixed in the 6.0.6 runtime release, I verified the issue doesn't happen with this or a later version.

@ghost ghost locked as resolved and limited conversation to collaborators Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants