Skip to content

Commit

Permalink
Fixed failure to open resource in non-ASCII paths
Browse files Browse the repository at this point in the history
Resource paths were being erroneously converted to utf-8, which didn't
work when later passed to the Windows API.

Thanks to @snail-coupe for reporting this.
  • Loading branch information
simonowen committed Mar 24, 2020
1 parent e163d61 commit f277fa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Win32/OSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const char* OSD::MakeFilePath(int nDir_, const char* pcszFile_/*=""*/)
{
GetModuleFileName(GetModuleHandle(NULL), szPath, MAX_PATH);
auto path = fs::path(szPath).remove_filename() / pcszFile_;
strncpy(szPath, path.u8string().c_str(), MAX_PATH - 1);
strncpy(szPath, path.string().c_str(), MAX_PATH - 1);
}

// Return a pointer to the new path
Expand Down

0 comments on commit f277fa9

Please sign in to comment.