Closed umireon closed 6 months ago
I will check on Windows but it uses std::wstring on Windows.
I have checked it on Windows having multi-byte characters on the path and noticed that the current path handling wouldn't work under some conditions so I have added a code to handle multi-byte characters properly.
Please review again, @royshil
Closes #525
Given
std::string s
,s.c_str()
will be released whens
is released. If you want to uses.c_str()
later, you have to holds
until you uses.c_str()
.On Windows, char paths are stored as multi-byte characters which Windows defines and it is hard to manipulate them with C++ standard libraries (codecvt was deprecated in C++17) so I propose to convert multi-byte characters with Windows-specific API that is guaranteed to work with multi-byte characters on Windows.