mirror of
https://github.com/encounter/aurora.git
synced 2026-07-09 18:19:33 -07:00
d61a1824ac
* 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
12 lines
309 B
C++
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()) };
|
|
}
|