This tutorial will guide your on how to obtain the Windows system locale using of Visual C++. The locale output will be presented in ISO format:

For example, United States English will be presented as en-US. United Kingdom will be presented as en_GB. Germany german will be presented as de_DE, etc

Let’s create a C++ Win32 project using Visual C++ 2010 Expresss. Enter the following code to the main().

Compile and run the project. Try to change the regional and language setting of your system. You may observe the output as following:

Get System Locale in Visual C++