3 ms·
I am curious how bstr relates to OsString. Is the difference that OsString can be WTF16 on Windows?
by fanf2 4y ago
I am curious how bstr relates to OsString. Is the difference that OsString can be WTF16 on Windows?
- burntsushi 4y agoOsStr uses WTF-8 on Windows, and just represents the raw underlying bytes on Unix. Byte strings can be WTF-8. They can be anything. The problem is that there is no real way to (easily) get the underlying WTF-8 bytes of an OsStr on Windows. So there's no free conversion to and from byte strings. I wrote more about this in the bstr docs (and don't miss the link to os_str_bytes): https://docs.rs/bstr/latest/bstr/#file-paths-and-os-strings https://docs.rs/bstr/latest/bstr/#file-paths-and-os-strings I'd be happy to answer more questions if you have them. :-) https://github.com/BurntSushi/bstr/discussions https://github.com/BurntSushi/bstr/discussions