mirror of
https://github.com/SFML/SFML.git
synced 2025-01-31 13:45:13 +08:00
Always print filepaths as UTF-8 to a char stream #3406
This commit is contained in:
parent
4378a022e5
commit
7c60447a39
@ -44,8 +44,10 @@ std::string toLower(std::string str)
|
||||
std::string formatDebugPathInfo(const std::filesystem::path& path)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << " Provided path: " << path << '\n' //
|
||||
<< " Absolute path: " << std::filesystem::absolute(path);
|
||||
// convert to UTF-8 to handle non-ascii/non-latin1 filenames on windows
|
||||
// cast is required to work in C++20 where u8string is char8_t which can't be printed to char stream
|
||||
oss << " Provided path: " << reinterpret_cast<const char*>(path.u8string().c_str()) << '\n' //
|
||||
<< " Absolute path: " << reinterpret_cast<const char*>(std::filesystem::absolute(path).u8string().c_str());
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user