Skip to content

Commit

Permalink
fix: compatible with Chinese paths (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
liu-jin-yi authored Sep 20, 2024
1 parent 660c8c9 commit 4956882
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ std::wstring stringToWString(const std::string& s)
{
int length;
int slength = (int)s.length() + 1;
length = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0);
length = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), slength, 0, 0);
std::wstring buf;
buf.resize(length);
MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, const_cast<wchar_t*>(buf.c_str()), length);
MultiByteToWideChar(CP_UTF8, 0, s.c_str(), slength, const_cast<wchar_t*>(buf.c_str()), length);
return buf;
}

Expand Down

0 comments on commit 4956882

Please sign in to comment.