bungeman@google.com | 07a69f8 | 2013-04-02 14:12:38 +0000 | [diff] [blame] | 1 | #include "windows.h" |
| 2 | #include "stdio.h" |
| 3 | |
| 4 | #define BUFFER_SIZE 512 |
| 5 | BOOL 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.com | 041e2db | 2013-04-03 07:01:14 +0000 | [diff] [blame] | 20 | |
bungeman@google.com | 07a69f8 | 2013-04-02 14:12:38 +0000 | [diff] [blame] | 21 | if (lcid > 0x8000) { |
| 22 | wprintf(L"//"); |
| 23 | } |
| 24 | wprintf(L" { 0x%.4x, \"%s\" }, //%s\n", lcid, pStr, wcBuffer); |
| 25 | |
| 26 | return (TRUE); |
| 27 | } |
| 28 | |
| 29 | int main(int argc, wchar_t* argv[]) { |
| 30 | EnumSystemLocalesEx(MyFuncLocaleEx, LOCALE_ALL, NULL, NULL); |
| 31 | } |