diff options
author | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-02 14:12:38 +0000 |
---|---|---|
committer | bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-02 14:12:38 +0000 |
commit | 07a69f848cd6e28e0870ac9eeeba2d05f8e8d8be (patch) | |
tree | 2cc4f9d2011b7f11dd1a1bd6c67e9e3ece6fd335 /tools/win_lcid.cpp | |
parent | 42eff161a2acdbf03a71666b3fc31079a1bba86f (diff) |
Name table iterator.
https://codereview.appspot.com/8180043/
git-svn-id: http://skia.googlecode.com/svn/trunk@8480 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools/win_lcid.cpp')
-rw-r--r-- | tools/win_lcid.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/win_lcid.cpp b/tools/win_lcid.cpp new file mode 100644 index 0000000000..b1f8237f5a --- /dev/null +++ b/tools/win_lcid.cpp @@ -0,0 +1,31 @@ +#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); +} |