Skip to content

Commit

Permalink
Fixes #173: Convert strings passed from node using UTF-8, not the sys…
Browse files Browse the repository at this point in the history
…tem code page
  • Loading branch information
the-ress authored and Tyriar committed Oct 12, 2016
1 parent ed3c9da commit 36b5b6f
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 36b5b6f

Please sign in to comment.