Skip to content

Commit

Permalink
Maybe resolves #84
Browse files Browse the repository at this point in the history
  • Loading branch information
ClassicOldSong committed Oct 26, 2024
1 parent d46aecc commit 551999b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platform/windows/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,7 @@ namespace platf {
}

// Get the output size required to store the string
auto output_size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, string.data(), string.size(), nullptr, 0);
auto output_size = MultiByteToWideChar(CP_UTF8, 0, string.data(), string.size(), nullptr, 0);
if (output_size == 0) {
auto winerr = GetLastError();
BOOST_LOG(error) << "Failed to get UTF-16 buffer size: "sv << winerr;
Expand All @@ -1857,7 +1857,7 @@ namespace platf {

// Perform the conversion
std::wstring output(output_size, L'\0');
output_size = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, string.data(), string.size(), output.data(), output.size());
output_size = MultiByteToWideChar(CP_UTF8, 0, string.data(), string.size(), output.data(), output.size());
if (output_size == 0) {
auto winerr = GetLastError();
BOOST_LOG(error) << "Failed to convert string to UTF-16: "sv << winerr;
Expand Down
1 change: 1 addition & 0 deletions src/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ namespace proc {
// when it contains spaces. Unlike POSIX, Windows forbids quotes in paths,
// so we can safely strip them all out here to avoid confusing the user.
boost::erase_all(ctx.working_dir, "\"");
ctx.working_dir += '\\';
#endif
}

Expand Down

0 comments on commit 551999b

Please sign in to comment.