From 6f98915c32d1bb8e59dcd8963231affab6854be5 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 28 Jun 2017 09:48:28 +0200 Subject: [PATCH 1/2] Fix DoFileSearch for non-ASCII paths on Windows It didn't work when there were non-ASCII characters in the directories argument, but it worked fine with non-ASCII characters in names of found files and folders. --- Source/Core/Common/FileSearch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index cca5c095f7..bce8e77b8e 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -100,12 +100,12 @@ std::vector DoFileSearch(const std::vector& directorie if (recursive) { // TODO use fs::directory_options::follow_directory_symlink ? - for (auto& entry : fs::recursive_directory_iterator(fs::path(directory))) + for (auto& entry : fs::recursive_directory_iterator(fs::u8path(directory))) add_filtered(entry); } else { - for (auto& entry : fs::directory_iterator(fs::path(directory))) + for (auto& entry : fs::directory_iterator(fs::u8path(directory))) add_filtered(entry); } } From 98b0d8a1197c6402b030258685b2eb6e1cd74e39 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 28 Jun 2017 09:50:02 +0200 Subject: [PATCH 2/2] Fix DoFileSearch for non-ASCII extensions on Windows We don't use non-ASCII extensions for anything right now, but we might as well fix this. --- Source/Core/Common/FileSearch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index bce8e77b8e..2994e00a74 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -74,7 +74,7 @@ std::vector DoFileSearch(const std::vector& directorie std::vector native_exts; for (const auto& ext : exts) - native_exts.push_back(ext); + native_exts.push_back(fs::u8path(ext)); // N.B. This avoids doing any copies auto ext_matches = [&native_exts](const fs::path& path) {