views:

1784

answers:

1

When should I call CultureInfo.CreateSpecificCulture(String) rather then CultureInfo.GetCultureInfo(String). The MSDN documentation is not very clear.

Also is there a way to cheaper check if the name of a culture is valid?

I think if you pass “en” rather then “en-GB” to CultureInfo.CreateSpecificCulture(String) you will get an error, but that CultureInfo.GetCultureInfo(String) does not mind. E.g. CultureInfo.GetCultureInfo(String) can cope if you only pass an language. However I am still unclear on this.

+1  A: 

It depends a bit on what you need the culture for. The short names ("en", "fr" etc) are used for neutral cultures, sufficient for eg language specific resource management. But for numerical and date formatting you need a specific culture, like "en-GB" etc.

And CultureInfo.CreateSpecificCulture("en"); works fine over here. It is especially intended to get 'a' specific culture for a neutral one.

Henk Holterman