dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.41k stars 4.76k forks source link

Globilization country list only returns 2 characters and not the full name #110035

Open vsfeedback opened 1 day ago

vsfeedback commented 1 day ago

This issue has been moved from a ticket on Developer Community.


I am using .Net 8 Visual Studio Version 17.11.5 and Blazor webassembly console app. Using similar code in .net framword 4.7 I do get the full country name but not in my application

The output produced:

de de deu DEU de de
de-DE de deu DEU de (DE) de (DE)
en en eng ENU en en

The code I am using

@using System.Globalization; Console.WriteLine("CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME"); foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures)) { Console.Write("{0,-7}", ci.Name); Console.Write(" {0,-3}", ci.TwoLetterISOLanguageName); Console.Write(" {0,-3}", ci.ThreeLetterISOLanguageName); Console.Write(" {0,-3}", ci.ThreeLetterWindowsLanguageName); Console.Write(" {0,-40}", ci.DisplayName); Console.WriteLine(" {0,-40}", ci.EnglishName); }

The sample code from [https://learn.microsoft.com/en-us/dotnet/api/system.globalization.culturetypes?view=net-8.0]() returns the full name CULTURE ISO ISO WIN DISPLAYNAME ENGLISHNAME ar ar ara ARA Arabic Arabic bg bg bul BGR Bulgarian Bulgarian


Original Comments

Feedback Bot on 11/10/2024, 05:32 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

mkArtakMSFT commented 1 day ago

@lewing I think this is by-design, but wanted to get you to answer here.

dotnet-policy-service[bot] commented 1 day ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

dotnet-policy-service[bot] commented 1 day ago

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

tarekgh commented 10 hours ago

CC @ilonatommy