Skip to content

Instantly share code, notes, and snippets.

@tiesmaster
Created September 28, 2011 12:53
Show Gist options
  • Save tiesmaster/1247854 to your computer and use it in GitHub Desktop.
Save tiesmaster/1247854 to your computer and use it in GitHub Desktop.
Retrieve the default user locale on Windows
#include <windows.h>
#include <stdio.h>
void main() {
char locale_name[32];
if (GetLocaleInfo (LOCALE_USER_DEFAULT,
LOCALE_SABBREVLANGNAME | LOCALE_USE_CP_ACP,
locale_name, sizeof (locale_name)))
{
printf("%s\n", locale_name);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment