blob: f4901719ecf6efb583499f39933b79bb67aa21fe [file] [log] [blame]
bungeman@google.com07a69f82013-04-02 14:12:38 +00001#include "windows.h"
2#include "stdio.h"
3
4#define BUFFER_SIZE 512
5BOOL CALLBACK MyFuncLocaleEx(LPWSTR pStr, DWORD dwFlags, LPARAM lparam) {
6 WCHAR wcBuffer[BUFFER_SIZE];
7 int bufferSize;
8
9 bufferSize = GetLocaleInfoEx(pStr, LOCALE_SENGLANGUAGE, wcBuffer, BUFFER_SIZE);
10 if (bufferSize == 0) {
11 wprintf(L"Locale %s had error %d\n", pStr, GetLastError());
12 return (TRUE);
13 }
14
15 LCID lcid = LocaleNameToLCID(pStr, NULL);
16 if (lcid == 0) {
17 wprintf(L"Error %d getting LCID\n", GetLastError());
18 return (TRUE);
19 }
skia.committer@gmail.com041e2db2013-04-03 07:01:14 +000020
bungeman@google.com07a69f82013-04-02 14:12:38 +000021 if (lcid > 0x8000) {
22 wprintf(L"//");
23 }
24 wprintf(L" { 0x%.4x, \"%s\" }, //%s\n", lcid, pStr, wcBuffer);
25
26 return (TRUE);
27}
28
29int main(int argc, wchar_t* argv[]) {
30 EnumSystemLocalesEx(MyFuncLocaleEx, LOCALE_ALL, NULL, NULL);
31}