From bab9cae71f5cd5a0078853e64bdf1d1f8af1fc30 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Wed, 9 Dec 2020 18:52:36 -0300 Subject: common/file_util: Let std::filesystem cast from UTF16 to std::string Fix invalid encoding paths when iterating over a directory on Windows. --- src/common/file_util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/file_util.cpp') diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 7752c0421..a286b9341 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -239,7 +239,7 @@ bool ForeachDirectoryEntry(u64* num_entries_out, const std::string& directory, } // windows loop do { - const std::string virtual_name(Common::UTF16ToUTF8(ffd.cFileName)); + const std::string virtual_name = std::filesystem::path(ffd.cFileName).string(); #else DIR* dirp = opendir(directory.c_str()); if (!dirp) -- cgit v1.2.3