sys: Improved UTF-8 path handling in various places

Fixes #768
This commit is contained in:
WerWolv
2022-10-04 09:10:58 +02:00
parent b17cd3696c
commit b80517ab15
20 changed files with 61 additions and 52 deletions

View File

@@ -27,7 +27,7 @@ namespace hex::magic {
for (const auto &dir : fs::getDefaultPaths(fs::ImHexPath::Magic)) {
for (const auto &entry : std::fs::directory_iterator(dir, error)) {
if (entry.is_regular_file() && ((sourceFiles && entry.path().extension().empty()) || (!sourceFiles && entry.path().extension() == ".mgc"))) {
magicFiles += fs::toShortPath(entry.path()).string() + MAGIC_PATH_SEPARATOR;
magicFiles += hex::toUTF8String(fs::toShortPath(entry.path())) + MAGIC_PATH_SEPARATOR;
}
}
}