Skip to content

Commit

Permalink
Fixes microsoft#173: Convert strings passed from node using UTF-8, no…
Browse files Browse the repository at this point in the history
…t the system code page
  • Loading branch information
the-ress committed Oct 12, 2016
1 parent fe63a41 commit fbf5758
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/win/pty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit fbf5758

Please sign in to comment.