Yow-Hann Lee - Software Happens

All things Computer Science, .NET & WWW

  Home  |   Contact  |   Syndication    |   Login
  131 Posts | 7 Stories | 35 Comments | 50 Trackbacks

News


Article Categories

Archives

Post Categories

About

The site, http://support.microsoft.com/kb/867460, list all the known bug fixes for the .NET Framework 1.1 in Service Pack 1. The following change in behavior from previous builds of .NET 1.1 is not an item listed on the support page.

So in continuation with my previous blog entry highlighting interesting little quirks in Globalization efforts in .NET, I would like to point one out for Serbian.

The following:

CultureInfo ci = new CultureInfo("sr");

Console.WriteLine(ci.NativeName);

will return the expected output of "srpski" to you IF you have .NET 1.1 SP1 installed. (You can determine which build number of .NET 1.1 you have installed by checking the version of mscorlib.dll, Microsoft CLR Class Library, on your machine).

For example, if you had the original RTM (1.1.4322.573) or another earlier release (1.1.4322.985), the above code will throw an exception on you.

However, you will be fine if you have the latest .NET build (1.1.4322.2300).

Just to add to this, "sr" is recognized by CultureInfo but is not highlighted in the documentation. According to the .NET 1.1 SDK doc (ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemGlobalizationCultureInfoClassTopic.htm), documented strings for Serbian are "sr-SP-Cyrl" and "sr-SP-Latn". Notice how the two letter representation "sr" is not mentioned. However, for other languages with different locales (i.e. French), it also includes the two letter representation, "fr" in its documentation.

Microsoft Support and MSDN do a great job of providing instructions and highlighting issues. But as the saying goes, "there are just so many things and so little time". Catching all the quirks here and there is not an easy task. So this is where the MSDN Community Content/Wiki kicks in.

In a future blog entry, I will highlight some of the discrepancies in dealing with identifying the user language directly from the http request and mapping it to a culture. In the meantime, Happy Globalization.

posted on Saturday, January 13, 2007 11:47 AM