mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
(Windows) Fixed an issue where Unicode characters in folder names would sometimes crash the application
This commit is contained in:
parent
436d21ec92
commit
78a4223b8e
|
@ -71,21 +71,25 @@ namespace Utils
|
|||
return contentList;
|
||||
|
||||
if (recursive) {
|
||||
for (auto& entry : std::filesystem::recursive_directory_iterator(genericPath)) {
|
||||
#if defined(_WIN64)
|
||||
for (auto& entry : std::filesystem::recursive_directory_iterator(
|
||||
Utils::String::stringToWideString(genericPath))) {
|
||||
contentList.emplace_back(
|
||||
Utils::String::wideStringToString(entry.path().generic_wstring()));
|
||||
#else
|
||||
for (auto& entry : std::filesystem::recursive_directory_iterator(genericPath)) {
|
||||
contentList.emplace_back(entry.path().generic_string());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (auto& entry : std::filesystem::directory_iterator(genericPath)) {
|
||||
#if defined(_WIN64)
|
||||
for (auto& entry : std::filesystem::directory_iterator(
|
||||
Utils::String::stringToWideString(genericPath))) {
|
||||
contentList.emplace_back(
|
||||
Utils::String::wideStringToString(entry.path().generic_wstring()));
|
||||
#else
|
||||
for (auto& entry : std::filesystem::directory_iterator(genericPath)) {
|
||||
contentList.emplace_back(entry.path().generic_string());
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue