List of locales in Windows

前端 未结 2 1513
醉酒成梦
醉酒成梦 2020-12-19 08:08

On *nix systems you can do locale -a to get a list of available locales.

What is the equivalent command (or action) in Windows?

I\'ve seen lists

2条回答
  •  猫巷女王i
    2020-12-19 08:55

    Initially, I couldn't find a C/Win32 API to get the information. (See later edit.) However, it looks like the .NET class System.Globalization.CultureInfo could provide the information you need. In particular, see CultureInfo.GetCultures(). This page seems to have a complete example of what you are looking for.

    EDIT: If you prefer a C/Win32 API, see EnumSystemLocales() function.

    EDIT 2: This example shows how to convert an LCID (which you get from EnumSystemLocales()) into a string useable by setlocale().

提交回复
热议问题