2 * Copyright 2013 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
10 #define BUFFER_SIZE 512
11 BOOL CALLBACK MyFuncLocaleEx(LPWSTR pStr, DWORD dwFlags, LPARAM lparam) {
12 WCHAR wcBuffer[BUFFER_SIZE];
15 bufferSize = GetLocaleInfoEx(pStr, LOCALE_SENGLANGUAGE, wcBuffer, BUFFER_SIZE);
16 if (bufferSize == 0) {
17 wprintf(L"Locale %s had error %d\n", pStr, GetLastError());
21 LCID lcid = LocaleNameToLCID(pStr, nullptr);
23 wprintf(L"Error %d getting LCID\n", GetLastError());
30 wprintf(L" { 0x%.4x, \"%s\" }, //%s\n", lcid, pStr, wcBuffer);
35 int main(int argc, wchar_t* argv[]) {
36 EnumSystemLocalesEx(MyFuncLocaleEx, LOCALE_ALL, nullptr, nullptr);