P3904R3 — When paths go WTF: making formatting lossless
Victor Zverovich
SG16
Revisions R3Aug 2026R2Aug 2026R1Feb 2026
[P2845], adopted in C++26, added formatting support for `std::filesystem::path`, addressing encoding issues and making formatting of a path as an ordinary (`char`) string lossless except for one case, unpaired surrogates on Windows. This paper proposes addressing this case and making such formatting lossless by default via the WTF-8 encoding ([WTF-8]). This will improve consistency in path handling between Windows and POSIX platforms and align with the design of `std::format` where the default formatting is normally lossless.