| 1 |
#![cfg(windows)] |
| 2 |
use std::ffi::{OsStr, OsString}; |
| 3 |
use std::os::windows::ffi::{OsStrExt, OsStringExt}; |
| 4 |
|
| 5 |
pub(crate) fn os_to_wide(s: &OsStr) -> Vec<u16> { |
| 6 |
s.encode_wide().collect() |
| 7 |
} |
| 8 |
|
| 9 |
pub(crate) fn os_from_wide(s: &[u16]) -> OsString { |
| 10 |
OsString::from_wide(s) |
| 11 |
} |