blob: 8cb7463d4951d355b2982122b6bc8fccfc8ec149 [file] [log] [blame]
halcanary96fcdcc2015-08-27 07:41:13 -07001/*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
bungeman@google.com07a69f82013-04-02 14:12:38 +00007#include "windows.h"
8#include "stdio.h"
9
10#define BUFFER_SIZE 512
11BOOL CALLBACK MyFuncLocaleEx(LPWSTR pStr, DWORD dwFlags, LPARAM lparam) {
12 WCHAR wcBuffer[BUFFER_SIZE];
13 int bufferSize;
14
15 bufferSize = GetLocaleInfoEx(pStr, LOCALE_SENGLANGUAGE, wcBuffer, BUFFER_SIZE);
16 if (bufferSize == 0) {
17 wprintf(L"Locale %s had error %d\n", pStr, GetLastError());
18 return (TRUE);
19 }
20
halcanary96fcdcc2015-08-27 07:41:13 -070021 LCID lcid = LocaleNameToLCID(pStr, nullptr);
bungeman@google.com07a69f82013-04-02 14:12:38 +000022 if (lcid == 0) {
23 wprintf(L"Error %d getting LCID\n", GetLastError());
24 return (TRUE);
25 }
skia.committer@gmail.com041e2db2013-04-03 07:01:14 +000026
bungeman@google.com07a69f82013-04-02 14:12:38 +000027 if (lcid > 0x8000) {
28 wprintf(L"//");
29 }
30 wprintf(L" { 0x%.4x, \"%s\" }, //%s\n", lcid, pStr, wcBuffer);
31
32 return (TRUE);
33}
34
35int main(int argc, wchar_t* argv[]) {
halcanary96fcdcc2015-08-27 07:41:13 -070036 EnumSystemLocalesEx(MyFuncLocaleEx, LOCALE_ALL, nullptr, nullptr);
bungeman@google.com07a69f82013-04-02 14:12:38 +000037}