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>
1045
1045
蕭澧邦 <45505768+shou692199@users.noreply.github.com>
1046
1046
谢乃闻 <sienaiwun@users.noreply.github.com>
1047
1047
Нияз Гарифзянов <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;
76
76
static std::string path_str (const fs::path & path) {
77
77
std::string u8path;
78
78
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
79
85
u8path = path.u8string ();
86
+ #endif
80
87
} catch (...) {
81
88
}
82
89
return u8path;
You can’t perform that action at this time.
0 commit comments