Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjNullj <iontankatchker@gmail.com>2022-11-11 13:21:30 +0300
committerGitHub <noreply@github.com>2022-11-11 13:21:30 +0300
commitafc7dcd83c2f49e76ddf7db2e746736f783fc605 (patch)
tree62ba02c77221e2be810e237f86951bdaaa0f8b15
parent3cbe4df8c753bc17197cf8615948a275ea524d96 (diff)
Add Unicode support for database filenames on Windows (#8782)HEADdevelop
Fixes #8751
-rw-r--r--src/main.cpp7
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);
}
}