mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-12 07:29:07 +08:00
fix windows stdout messy code (#2546)
* fix windows stdout messy code * fix type name error * remoe unnecessary codepoint check.
This commit is contained in:
parent
71e7e16a61
commit
9eb997fc0b
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user