2015-08-27 14:41:13 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2013 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2019-05-15 13:28:52 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#include <stdio.h>
|
2013-04-02 14:12:38 +00:00
|
|
|
|
|
|
|
#define BUFFER_SIZE 512
|
|
|
|
BOOL CALLBACK MyFuncLocaleEx(LPWSTR pStr, DWORD dwFlags, LPARAM lparam) {
|
|
|
|
WCHAR wcBuffer[BUFFER_SIZE];
|
|
|
|
int bufferSize;
|
|
|
|
|
|
|
|
bufferSize = GetLocaleInfoEx(pStr, LOCALE_SENGLANGUAGE, wcBuffer, BUFFER_SIZE);
|
|
|
|
if (bufferSize == 0) {
|
|
|
|
wprintf(L"Locale %s had error %d\n", pStr, GetLastError());
|
|
|
|
return (TRUE);
|
|
|
|
}
|
|
|
|
|
2015-08-27 14:41:13 +00:00
|
|
|
LCID lcid = LocaleNameToLCID(pStr, nullptr);
|
2013-04-02 14:12:38 +00:00
|
|
|
if (lcid == 0) {
|
|
|
|
wprintf(L"Error %d getting LCID\n", GetLastError());
|
|
|
|
return (TRUE);
|
|
|
|
}
|
2013-04-03 07:01:14 +00:00
|
|
|
|
2013-04-02 14:12:38 +00:00
|
|
|
if (lcid > 0x8000) {
|
|
|
|
wprintf(L"//");
|
|
|
|
}
|
|
|
|
wprintf(L" { 0x%.4x, \"%s\" }, //%s\n", lcid, pStr, wcBuffer);
|
|
|
|
|
|
|
|
return (TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, wchar_t* argv[]) {
|
2015-08-27 14:41:13 +00:00
|
|
|
EnumSystemLocalesEx(MyFuncLocaleEx, LOCALE_ALL, nullptr, nullptr);
|
2013-04-02 14:12:38 +00:00
|
|
|
}
|