Filesystem Surprise
summary
Notes that std::filesystem::path constructors assume the source char encoding is the OS native narrow encoding, so a UTF‑8 std::string on Windows is interpreted using the locale (often Latin-1) not UTF‑8. Code that constructs path from std::string therefore requires an explicit convert to wstring to work on Windows; doing that can then break on Linux in quick handwritten examples. C++20/23 u8 string integration fixes new code, but legacy bases remain vulnerable.
AI-written summary · about








