File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1045,3 +1045,4 @@ zrm <trustiosity.zrm@gmail.com>
10451045蕭澧邦 <45505768+shou692199@users.noreply.github.com>
10461046谢乃闻 <sienaiwun@users.noreply.github.com>
10471047Нияз Гарифзянов <112617865+garrnizon@users.noreply.github.com>
1048+ Jason C.H <ctrysbita@outlook.com>
Original file line number Diff line number Diff line change @@ -76,7 +76,14 @@ namespace fs = std::filesystem;
7676static std::string path_str (const fs::path & path) {
7777 std::string u8path;
7878 try {
79+ #if defined(__cpp_lib_char8_t)
80+ // C++20 and later: u8string() returns std::u8string
81+ std::u8string u8str = path.u8string ();
82+ u8path = std::string (reinterpret_cast <const char *>(u8str.c_str ()));
83+ #else
84+ // C++17: u8string() returns std::string
7985 u8path = path.u8string ();
86+ #endif
8087 } catch (...) {
8188 }
8289 return u8path;
You can’t perform that action at this time.
0 commit comments