Fix problem with UTF-8 output when switching the code page under windows fails.
This commit is contained in:
@@ -127,8 +127,9 @@ void CP_Init (void)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (IsTTY) {
|
if (IsTTY) {
|
||||||
CodePage = GetConsoleOutputCP ();
|
CodePage = GetConsoleOutputCP ();
|
||||||
if (SetConsoleOutputCP (CP_UTF8)) {
|
IsUTF8 = (int) SetConsoleOutputCP (CP_UTF8);
|
||||||
IsUTF8 = 1;
|
if (IsUTF8) {
|
||||||
|
/* Switch the code page back on exit */
|
||||||
atexit (Cleanup);
|
atexit (Cleanup);
|
||||||
}
|
}
|
||||||
if (Color) {
|
if (Color) {
|
||||||
|
|||||||
Reference in New Issue
Block a user