From 1ab21d9900b6a9b583ddef334f695f8575699806 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 28 Apr 2021 14:33:45 -0700 Subject: [PATCH] Fixed localized error strings --- Texassemble/texassemble.cpp | 6 +++++- Texconv/texconv.cpp | 4 ++++ Texdiag/texdiag.cpp | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index 4066675..7f21edc 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -27,9 +27,10 @@ #include #include #include +#include +#include #include #include -#include #include #include @@ -857,6 +858,9 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) wchar_t szOutputFile[MAX_PATH] = {}; + // Set locale for output since GetErrorDesc can get localized strings. + std::locale::global(std::locale("")); + // Initialize COM (needed for WIC) HRESULT hr = hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if (FAILED(hr)) diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index 42d63c9..4f24013 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -1289,6 +1290,9 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) wchar_t szSuffix[MAX_PATH] = {}; wchar_t szOutputDir[MAX_PATH] = {}; + // Set locale for output since GetErrorDesc can get localized strings. + std::locale::global(std::locale("")); + // Initialize COM (needed for WIC) HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if (FAILED(hr)) diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index 96f5f87..2511f0a 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -3104,6 +3105,9 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) uint32_t fileType = WIC_CODEC_BMP; wchar_t szOutputFile[MAX_PATH] = {}; + // Set locale for output since GetErrorDesc can get localized strings. + std::locale::global(std::locale("")); + // Initialize COM (needed for WIC) HRESULT hr = hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if (FAILED(hr))