OsStr-related APIs have already exposed and locked its implementation to be WTF-8 forever.
OsStr couldn’t be implemented as stored as UCS2/UTF-16, or even an arbitrary 8-bit codepage, because
str is explicitly UTF-8 and implements non-allocating non-fallible
AsRef<OsStr> (and there are more APIs like that).
So given that WTF-8 is the only possible implementation of
OsStr's interface, can we drop the platform-dependence charade, and make
I wouldn’t mind making
encode_wide() cross-platform too, because it’s easier to run tests/CI on non-Windows even if the code is meant for Windows.