Files
aurora/lib/fs_helper.hpp
Pieter-Jan Briers d61a1824ac Fix handling of Unicode paths on Windows (#166)
* Fix handling of Unicode paths on Windows

I love C++

* Reduce the amount of reinterpret_casts

* Okay? Don't commit the file CLion? Why not?

* Fix texture replacements too
2026-05-10 10:54:59 -06:00

12 lines
309 B
C++

#pragma once
#include <filesystem>
/**
* Converts a std::filesystem::path to a std::string, UTF-8, without exploding on Windows.
*/
inline std::string fs_path_to_string(const std::filesystem::path& path) {
const auto u8str = path.u8string();
return { reinterpret_cast<const char*>(u8str.c_str()) };
}