diff options
author | jNullj <iontankatchker@gmail.com> | 2022-11-11 13:21:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-11 13:21:30 +0300 |
commit | afc7dcd83c2f49e76ddf7db2e746736f783fc605 (patch) | |
tree | 62ba02c77221e2be810e237f86951bdaaa0f8b15 | |
parent | 3cbe4df8c753bc17197cf8615948a275ea524d96 (diff) |
Fixes #8751
-rw-r--r-- | src/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 047e44740..47fe55483 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -120,11 +120,12 @@ int main(int argc, char** argv) // Get correct case for Windows filenames (fixes #7139) for (const auto& file : parser.positionalArguments()) { const auto fileInfo = QFileInfo(file); - WIN32_FIND_DATA findFileData; + WIN32_FIND_DATAW findFileData; HANDLE hFind; - hFind = FindFirstFile(fileInfo.absoluteFilePath().toUtf8(), &findFileData); + const wchar_t* absolutePathWchar = reinterpret_cast<const wchar_t*>(fileInfo.absoluteFilePath().utf16()); + hFind = FindFirstFileW(absolutePathWchar, &findFileData); if (hFind != INVALID_HANDLE_VALUE) { - fileNames << QString("%1/%2").arg(fileInfo.absolutePath(), QString::fromUtf8(findFileData.cFileName)); + fileNames << QString("%1/%2").arg(fileInfo.absolutePath(), QString::fromWCharArray(findFileData.cFileName)); FindClose(hFind); } } |