widestring/platform/
other.rs
1use std::ffi::{OsStr, OsString};
2
3pub(crate) fn os_to_wide(s: &OsStr) -> Vec<u16> {
4 s.to_string_lossy().encode_utf16().collect()
5}
6
7pub(crate) fn os_from_wide(s: &[u16]) -> OsString {
8 OsString::from(String::from_utf16_lossy(s))
9}