Supported cultures on an OS? CultureInfo.GetCultures won't work...

A

Alain Dekker

Hi,

I'm running a C# app on Windows CE using the Compact Framework v2.

The following is the code that I found from Googling to get the supported
cultures on the OS:
string specName = string.Empty;
string strName = string.Empty;
string strEngName = string.Empty;
foreach (CultureInfo ci in
CultureInfo.GetCultures(CultureTypes.AllCultures))
{
try { specName = CultureInfo.CreateSpecificCulture(ci.Name).Name; }
catch { }
strName = ci.Name;
strEngName = ci.EnglishName;
}

This works fine on Windows XP or higher, but "GetCultures" is not a
supported method on the CF v2 (code won't compile). This MSDN documentation
page says that it *is* supported (see right at bottom):

http://msdn.microsoft.com/en-us/library/system.globalization.culturetypes(v=vs.80).aspx

There is a little caveat in that article "The .NET Framework does not
support all versions of every platform".

Not sure why its not supported. In any case, is it posible to enumerate the
list of supported cultures if I cannot use "GetCultures"?

Thanks,
Alain
 
Top