mirror of
https://github.com/janet-lang/janet
synced 2025-07-05 11:32:54 +00:00
Hint utf8 output on windows console.
This commit is contained in:
parent
e1bd24c2ab
commit
bea6dbbf3d
@ -38,13 +38,14 @@ int main(int argc, char **argv) {
|
|||||||
JanetArray *args;
|
JanetArray *args;
|
||||||
JanetTable *env;
|
JanetTable *env;
|
||||||
|
|
||||||
/* Enable color console on windows 10 console. */
|
/* Enable color console on windows 10 console and utf8 output. */
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
DWORD dwMode = 0;
|
DWORD dwMode = 0;
|
||||||
GetConsoleMode(hOut, &dwMode);
|
GetConsoleMode(hOut, &dwMode);
|
||||||
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
||||||
SetConsoleMode(hOut, dwMode);
|
SetConsoleMode(hOut, dwMode);
|
||||||
|
SetConsoleOutputCP(65001);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set up VM */
|
/* Set up VM */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user