Change in .Net Framework Culture Names for Windows Vista


We’ve changed the culture names for the .Net Framework in Windows Vista to match the locale names used in Vista, which were changed to be more like the IETF standard names.  Previously .Net Framework 2.0 culture names looked like “language”-“country” or “language”-“country”-“script” if a script distinction was necessary. 


Additonally some names have been standardized to their ISO standard names, for example zh-Hant instead of zh-CHT.  The resulting names look like:


















   iu-Latn-CA    Inuktitut (Latin, Canada)
   zh-Hant    Chinese (Traditional)
   en-029    English (Caribbean)

Since some resources in the Framework may expect zh-CHT, the parent for zh-Hant is set to zh-CHT as a temporary aid for resource lookup.


In the event that an application needs to access locales by the pre-Vista names, they can create a custom culture with the old name using the CultureAndRegionInfoBuilder class.  For example:

using System;
using System.Globalization;

class Test
{
static void Main()
{
Console.WriteLine(new CultureInfo(“iu-Latn-CA”).DisplayName);
Console.WriteLine(new CultureInfo(“zh-Hant”).DisplayName);
Console.WriteLine(new CultureInfo(“en-029”).DisplayName);

CultureAndRegionInfoBuilder carib =
new CultureAndRegionInfoBuilder(“en-CB”, CultureAndRegionModifiers.None);
carib.LoadDataFromCultureInfo(new CultureInfo(“en-029”));
carib.LoadDataFromRegionInfo(new RegionInfo(“en-029”));
carib.Register();
Console.WriteLine(new CultureInfo(“en-CB”).DisplayName);

// This was just an example, I don’t really want this locale on my machine 🙂
CultureAndRegionInfoBuilder.Unregister(“en-CB”);
}
}

C:\examples>csc /r:sysglobl.dll test.cs
C:\examples>test.exe

Inuktitut (Latin, Canada)
Chinese (Traditional)
English (Caribbean)
English (Caribbean)


In this example, the first English (Caribbean) was written using the Vista name, and the second using the custom culture created using the pre-Vista name.


This will hopefully be more helpful to other applications since these names follow the standards more closely.  Web applications may have an easier time loading resources, although clients could still request resources for “en”, “en-US”, or “en-Latn-US”, yet the .Net Framework culture is “en-US”.

Comments (7)

  1. If you follow Shawn Steele’s blog you will have seen these already, but if you don’t and you care about…

  2. *** Updated on 20 June 2006 to reflect changes in culture names ***

    I’ve noticed some posts and comments…

  3. I don’t normally change existing posts, but I don’t want to be misleading.  With the change of…

  4. *** Updated on 20 June 2006 to reflect changes in culture names ***

    I’ve noticed some posts and comments…

  5. In order to follow RFC 4646 more closely (formerly RFC 3066 bis) we changed managed locale names in Windows

  6. *** Updated on 20 June 2006 to reflect changes in culture names *** I’ve noticed some posts and comments