Skip to content

Commit eac525c

Browse files
committed
WINDOWS: fix #6795. always read the terminal in unicode mode, and set the default codepage to Latin-1 (so that we can be certain that C programs can read/write ASCII data to the terminal successfully)
1 parent 0bb9d4f commit eac525c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

deps/libuv

Submodule libuv updated 1 file

src/support/libsupportinit.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ static int isInitialized = 0;
1616
void libsupport_init(void)
1717
{
1818
if (!isInitialized) {
19+
#ifdef _OS_WINDOWS_
20+
SetConsoleCP(1252); // ANSI Latin1; Western European (Windows)
21+
#endif
1922
setlocale(LC_ALL, ""); // set to user locale
2023
setlocale(LC_NUMERIC, "C"); // use locale-independent numeric formats
2124

0 commit comments

Comments
 (0)