From 36b5b6f73fd4fffe3848d3ffef973d521adbe950 Mon Sep 17 00:00:00 2001 From: Tereza Tomcova Date: Wed, 12 Oct 2016 14:58:56 +0200 Subject: [PATCH] Fixes #173: Convert strings passed from node using UTF-8, not the system code page --- src/win/pty.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/win/pty.cc b/src/win/pty.cc index 51fd4f24c..44fc0b97f 100644 --- a/src/win/pty.cc +++ b/src/win/pty.cc @@ -55,9 +55,9 @@ winpty_s::winpty_s() : const wchar_t* to_wstring(const String::Utf8Value& str) { const char *bytes = *str; - unsigned int sizeOfStr = MultiByteToWideChar(CP_ACP, 0, bytes, -1, NULL, 0); + unsigned int sizeOfStr = MultiByteToWideChar(CP_UTF8, 0, bytes, -1, NULL, 0); wchar_t *output = new wchar_t[sizeOfStr]; - MultiByteToWideChar(CP_ACP, 0, bytes, -1, output, sizeOfStr); + MultiByteToWideChar(CP_UTF8, 0, bytes, -1, output, sizeOfStr); return output; }