Questions tagged [regioninfo]
34 questions
21
votes
1 answer
Why is ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ the native name of the U.S.?
When I use this code:
var ri = new RegionInfo("us");
var nativeName = ri.NativeName; // ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ
why is nativeName then the string "ᏌᏊ ᎢᏳᎾᎵᏍᏔᏅ ᏍᎦᏚᎩ" (in Cherokee)?
If I change to new RegionInfo("US") (only difference, capital US), I get…

Jeppe Stig Nielsen
- 60,409
- 11
- 110
- 181
17
votes
5 answers
Best Practice - Format Multiple Currencies
What is best practice for the scenario listed below?
We have an application which we would like to support multiple currencies. The software will respect the users locale and regional settings to dictate the correct number format, i.e. $10,000.00 or…
Klondike
14
votes
6 answers
Get RegionInfo by country name?
I want to be able to get RegionInfo by doing the following:
new RegionInfo("United Kingdom");
but this throws an exception and says that it is not recognised.
This page on RegionInfo says that an exception is thrown if 'name is not a valid…

DevDave
- 6,700
- 12
- 65
- 99
11
votes
2 answers
.NET RegionInfo class
When I try to create a new RegionInfo with certain ISO 3166 country codes ("BD" for Bangladesh, "SO" for Somalia, "LK" for Sri Lanka), I get an ArgumentException that says it's not recognized.
What's the deal? The Intellisense of RegionInfo(string)…

core
- 32,451
- 45
- 138
- 193
7
votes
4 answers
Country name to ISO 3166-2 code
I know how to convert an ISO 3166-2 code to the full English name, e.g. "US" to "United States" by using RegionInfo.
However, how can I do the opposite, i.e. that takes "United States" and returns "US"?

jacobz
- 3,191
- 12
- 37
- 61
6
votes
7 answers
Get a country's continent in C#
Is there a way to find a country's continent in C#, using the RegionInfo class or any other way?
For example, you give the country name "Denmark" and it returns "Europe".

Mark Sillatson
- 63
- 1
- 3
5
votes
7 answers
How to get DayNames from language only in .NET
Assume that I only have a country code (en, de, fr) and I need to display the weekdays in this language.
I know about RegionInfo and CultureInfo - but I can't find a solution.
If I create a country info from (for an example) "en" I have no DateTime…

ManniAT
- 1,989
- 2
- 19
- 25
4
votes
1 answer
Different English name of Czechia on my local machine vs on Azure
I'm trying to get RegionInfo object by the country name. I've come up with this code:
var regions = CultureInfo.GetCultures(CultureTypes.SpecificCultures).Select(x => new RegionInfo(x.LCID));
var regionInfo = regions.FirstOrDefault(region =>…

bineros
- 51
- 4
3
votes
1 answer
Custom Neutral Culture does not show in Visual Studio Winform Language combobox
We need to create an OEM version of our WinForms app, which would have some different resource strings (OEM branding) than the base (en-US) version. This app is already localized for the neutral Japanese culture (ja).
I am trying to use custom…

Darryl
- 1,531
- 15
- 26
2
votes
1 answer
How to Find the Different .net version being referenced?
I am trying to find the ThreeLetterISORegionName of country "Cyprus" and "Virgin Islands". hence so I have used RegionInfo class using System.Globalization from mscorlib assembly.
RegionInfo regionInfo = new…

Mona
- 342
- 1
- 3
- 17
2
votes
2 answers
Get current country and location details using c#
I want to know where my application is used.
Here is the code for getting the country name and Time zone :
TimeZone localZone = TimeZone.CurrentTimeZone;
var result = localZone.StandardName;
var s = result.Split('…

Sangeetha
- 601
- 3
- 12
- 26
2
votes
2 answers
Currency format C# ISOCurrencySymbol
I would normally just use this:
double test = 1234.5678;
Console.WriteLine(test.ToString("C"));
which works great. I had an "overwrite" for canadian dollars to make sure that people would see the difference between US and Canadian dollars:
var…

JP Hellemons
- 5,977
- 11
- 63
- 128
2
votes
1 answer
Get country and timestamp for the current location
I want to know where my application is used.
Here is the code for getting the country name:
public string Country = RegionInfo.CurrentRegion.DisplayName;
Here is the code to get the timezone:
public void TimeStamp()
{
TimeZone zone =…

Loc Dai Le
- 1,661
- 4
- 35
- 70
1
vote
3 answers
How to find world region (or country) or language from the windows registry?
I'm working with a very old installer that can read Registry entries but has a difficulty (complex) time executing Windows APIs.
I'm trying to detect whether the PC it's being installed on is in Australia.
Any ideas?

Clay Nichols
- 11,848
- 30
- 109
- 170
1
vote
7 answers
Refactoring two basic classes
How would you refactor these two classes to abstract out the similarities? An abstract class? Simple inheritance? What would the refactored class(es) look like?
public class LanguageCode
{
///
/// Get the lowercase two-character…

core
- 32,451
- 45
- 138
- 193