fix windows stdout messy code (#2546)

* fix windows stdout messy code

* fix type name error

* remoe unnecessary  codepoint check.
This commit is contained in:
zhuangzhuang 2019-07-08 14:33:53 +08:00 committed by Egor Pugin
parent 71e7e16a61
commit 9eb997fc0b

View File

@ -69,6 +69,22 @@ static void Win32WarningHandler(const char* module, const char* fmt,
}
#endif /* HAVE_TIFFIO_H */
class AutoWin32ConsoleOutputCP {
public:
explicit AutoWin32ConsoleOutputCP(UINT codeCP) {
oldCP_ = GetConsoleOutputCP();
SetConsoleOutputCP(codeCP);
}
~AutoWin32ConsoleOutputCP() {
SetConsoleOutputCP(oldCP_);
}
private:
UINT oldCP_;
};
static AutoWin32ConsoleOutputCP autoWin32ConsoleOutputCP(CP_UTF8);
#endif // _WIN32
static void PrintVersionInfo() {