Skip to content

Commit

Permalink
WINDOWS: fix #6795. always read the terminal in unicode mode, and set…
Browse files Browse the repository at this point in the history
… the default codepage to Latin-1 (so that we can be certain that C programs can read/write ASCII data to the terminal successfully)
  • Loading branch information
vtjnash committed Jul 3, 2014
1 parent 0bb9d4f commit eac525c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deps/libuv
Submodule libuv updated 1 files
+22 −7 src/win/tty.c
3 changes: 3 additions & 0 deletions src/support/libsupportinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ static int isInitialized = 0;
void libsupport_init(void)
{
if (!isInitialized) {
#ifdef _OS_WINDOWS_
SetConsoleCP(1252); // ANSI Latin1; Western European (Windows)
#endif
setlocale(LC_ALL, ""); // set to user locale
setlocale(LC_NUMERIC, "C"); // use locale-independent numeric formats

Expand Down

0 comments on commit eac525c

Please sign in to comment.