4 ms·
OsString isn't Unix-specific. Or am I misunderstanding what you're saying?
by LambdaComplex 9y ago
OsString isn't Unix-specific. Or am I misunderstanding what you're saying?
- kibwen 9y agoI think what they're saying is that because Unix doesn't specify any string encoding at all, you can get GIGO by using OsStr on Unix.
- comex 9y agoYes, that's what I meant. Actually, both the Unix variant, "GIGO byte sequence probably UTF-8", and the Windows variant, "GIGO u16 sequence probably UTF-16", have cross-platform use cases. For example, the UTF-16 variant could be used when doing FFI with Java, or when reading Windows filesystems. Therefore, I think ideally Rust would provide both variants as cross-platform types, and OsString/OsStr would just be aliases for one or the other depending on the current platform.