From 81bd894c51a3ffdc422ace558215bed40378c33d Mon Sep 17 00:00:00 2001 From: Kevin Kwok Date: Tue, 21 Mar 2023 14:37:49 -0700 Subject: [PATCH] Update chat.cpp --- chat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chat.cpp b/chat.cpp index 4b90c29c1cc16..22f0a4ddf4a05 100644 --- a/chat.cpp +++ b/chat.cpp @@ -889,8 +889,10 @@ int main(int argc, char ** argv) { // Windows console ANSI color fix DWORD mode = 0; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); - if (hConsole && hConsole != INVALID_HANDLE_VALUE && GetConsoleMode(hConsole, &mode)) + if (hConsole && hConsole != INVALID_HANDLE_VALUE && GetConsoleMode(hConsole, &mode)){ SetConsoleMode(hConsole, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); + SetConsoleOutputCP(CP_UTF8); + } #endif fprintf(stderr, "%s: interactive mode on.\n", __func__);