Welcome to MSDN Blogs Sign in | Join | Help

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".

Published Friday, June 02, 2006 10:32 PM by shawnste

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Important changes in NLS than span Windows and the .NET Framework

If you follow Shawn Steele's blog you will have seen these already, but if you don't and you care about...
Sunday, June 04, 2006 9:25 AM by Sorting It All Out

# Cheating to Install Custom Cultures

*** Updated on 20 June 2006 to reflect changes in culture names ***
I've noticed some posts and comments...
Tuesday, June 20, 2006 2:43 PM by Shawn Steele's Blog

# I changed an earlier post

I don't normally change existing posts, but I don't want to be misleading.  With the change of...
Tuesday, June 20, 2006 2:49 PM by Shawn Steele's Blog

# Cheating to Install Custom Cultures - Updated 20 June 2006

*** Updated on 20 June 2006 to reflect changes in culture names ***
I've noticed some posts and comments...
Tuesday, August 29, 2006 3:16 PM by I'm not a Klingon

# Vista changes .Net 2.0 Locale Names, sample work around custom cultures/locales

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

Friday, October 13, 2006 3:06 PM by I'm not a Klingon

# Jokes by City » I’m not a Klingon : Change in .Net Framework Culture Names for Windows …

# Cheating to Install Custom Cultures - Updated 20 June 2006

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

Saturday, May 03, 2008 1:14 AM by I'm not a Klingon

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker