what is the difference between CultureTypes.AllCultures and CultureTypes.FrameworkCultures RRS feed

  • Question

  • User1183903743 posted
    I thought I had it sorted out by printing out the collections:

    CultureTypes.AllCultures has 226 cultures
    CultureTypes.FrameworkCultures has 203 cultures
    CultureTypes.WindowsOnlyCultures has 23 cultures and they are EXACTLY the ones missing from Framework cultures.
    So definitely Framework is a subset of AllCultures

    None of these collections are described as dependent on the platform of the machine used to do the printout. 
    AllCultures, contrary to both the poor choice of name and, more importantly, the msdn2 documentation, appears to refer to the windows system max supported cultures and not to the RFC specification. It seems like the Framework does not support all culture the system does(if installed) but the msdn2 docs make a mess of that logic.

    CultureTypes.FrameworkCultures is just plain not documented.

    Can anybody shed some light?


    Sunday, September 18, 2005 9:24 AM

All replies

  • User-94950375 posted
    I'm not sure the name is such a bad choice.  The documentation clearly states that CultureTypes is an enumeration of all the possible types that could be returned by  the CultureInfo.GetCultures Method, which returns a list of supported cultures filtered by the specified CultureTypes parameter.

    So FrameworkCultures filters the method to return only those cultures which ship with the .Net framework. WindowsOnly returns only those cultures which exist in windows only and AllCultures returns a list of supported cultures on that combination of the framework and Windows. 

    Of course you could argue that the framework should ship with all the RFC cultures [;)]

    Sunday, September 18, 2005 1:54 PM
  • User1183903743 posted

    Of course you could argue that the framework should ship with all the RFC cultures

    No, that may not be technologically possible as is actually the case with Chinese Traditional (zh-CHT). However, we should still have programmatic access to the ones listed in the RFC. Something like CultureTypes.RfcCultures. I filed this as a suggestion but this late in the cycle the Framework is locked down.

    AllCultures, contrary to both the poor choice of name

     I take that back. I now know that it is just an an enum option that includes all the other options.

    The CultureInfo.GetCultures is a helper method to retrieve the different collections. It consumes the enum(collection definition) as its param not define it. Trial and error is not the way to infer the definitions, because there could be custom cultures, and patches to the OS and the Framework too. If we are to write code to withstand this kind of unbeknown changes we have to rely SOLELY on the docs definitions.
    the msdn2 docs make a mess of that logic

    See  http://msdn.microsoft.com/en-us/library/9y39dxbc
    "InstalledWin32Cultures - All cultures that are installed in the Windows system. Note that not all cultures supported by the .NET Framework are installed in the Windows system." This implies the framework is the larger set. While that may be the ultimate goal, fact is currently exactly the opposite. Print them out for yourself.

    On a practical level in an ASP.NET context, custom cultures aside, should we even be concerned with anything but CultureTypes.FrameworkCultures(for now, the intuitive guess of the meaning of), if the runtime, ever so deeply integrated with IIS, won't support anything but?

    Monday, September 19, 2005 9:10 AM