From 83fa72542408ea0d187747be0cd46339dd134884 Mon Sep 17 00:00:00 2001 From: KentuckyCompass Date: Tue, 22 Jan 2013 06:59:22 -0800 Subject: [PATCH] std::string is not UTF8-aware --- Core/FileSystems/DirectoryFileSystem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/FileSystems/DirectoryFileSystem.cpp b/Core/FileSystems/DirectoryFileSystem.cpp index 93cd9ca7ad..b973875082 100644 --- a/Core/FileSystems/DirectoryFileSystem.cpp +++ b/Core/FileSystems/DirectoryFileSystem.cpp @@ -37,7 +37,7 @@ static bool FixFilenameCase(const std::string &path, std::string &filename) if (File::Exists(path + filename)) return true; - size_t filenameSize = filename.size(); + size_t filenameSize = filename.size(); // size in bytes, not characters for (size_t i = 0; i < filenameSize; i++) { filename[i] = tolower(filename[i]); @@ -57,7 +57,6 @@ static bool FixFilenameCase(const std::string &path, std::string &filename) while (!readdir_r(dirp, (dirent*) &diren, &result) && result) { - // Hm, is this check UTF-8 compatible? (size vs strlen) if (strlen(result->d_name) != filenameSize) continue;