From 801025c1663c6a077557f2c4cc446b9501f9ba18 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Feb 2024 03:57:50 -0600 Subject: [PATCH] [Hotfix] fs::exists(fs::path{name}) does not work for Chinese characters in windows --- common/file.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/file.cpp b/common/file.cpp index 632d1696b..fc147c1f9 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -47,7 +47,9 @@ namespace fs = std::filesystem; */ bool File::Exists(const std::string &name) { - return fs::exists(fs::path{name}); + // fs::exists(fs::path{name}) does not work for Chinese characters in windows + std::ifstream f(name); + return f.good(); } /**