On Mon, Jun 12, 2017 at 9:30 PM, Peter Dimov via Boost < boost@lists.boost.org> wrote:
Yakov Galka wrote:
That's not convincing. Why Windows has to be different in this regard?
Because it is. The file name on Windows physically is a sequence of uint16_t, whereas on Linux, it's a sequence of uint8_t. On Linux, any null-terminated byte sequence results in a perfect roundtrip, as it's stored unmodified, it's literally the exact same byte sequence as the one you gave. If the library tried to mess with the file name in any way, this would result in nothing but problems.
On Windows, it is simply not possible to have the exact same byte sequence stored as the file name. The file system does not use byte sequences, it uses uint16_t sequences.
Yeah, so? I say that the library can provide a Windows -> std::string -> Windows roundtrip just as it does with any other platform. If FreeBSD -> std::string conversion can return invalid UTF-8, then so does Windows -> std::string conversion. -- Yakov Galka http://stannum.co.il/