Skip to content

Commit fbf5758

Browse files
committed
Fixes microsoft#173: Convert strings passed from node using UTF-8, not the system code page
1 parent fe63a41 commit fbf5758

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/win/pty.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ winpty_s::winpty_s() :
5555
const wchar_t* to_wstring(const String::Utf8Value& str)
5656
{
5757
const char *bytes = *str;
58-
unsigned int sizeOfStr = MultiByteToWideChar(CP_ACP, 0, bytes, -1, NULL, 0);
58+
unsigned int sizeOfStr = MultiByteToWideChar(CP_UTF8, 0, bytes, -1, NULL, 0);
5959
wchar_t *output = new wchar_t[sizeOfStr];
60-
MultiByteToWideChar(CP_ACP, 0, bytes, -1, output, sizeOfStr);
60+
MultiByteToWideChar(CP_UTF8, 0, bytes, -1, output, sizeOfStr);
6161
return output;
6262
}
6363

0 commit comments

Comments
 (0)