skia2/tools/win_lcid.cpp
skia.committer@gmail.com 041e2dbc06 Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@8503 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-03 07:01:14 +00:00

32 lines
813 B
C++

#include "windows.h"
#include "stdio.h"
#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);
}
LCID lcid = LocaleNameToLCID(pStr, NULL);
if (lcid == 0) {
wprintf(L"Error %d getting LCID\n", GetLastError());
return (TRUE);
}
if (lcid > 0x8000) {
wprintf(L"//");
}
wprintf(L" { 0x%.4x, \"%s\" }, //%s\n", lcid, pStr, wcBuffer);
return (TRUE);
}
int main(int argc, wchar_t* argv[]) {
EnumSystemLocalesEx(MyFuncLocaleEx, LOCALE_ALL, NULL, NULL);
}