☰
Debian Codegraph
@
1.4.4-1
/
/
.cargo
/
vendor
/
widestring
/
src
/
platform
/
other.rs
☽
☼
.cargo/vendor/widestring/src/platform/other.rs
code
plain
raw
GPL-2
1998-2015, Sourcefire, Inc.; 2002-2007, Tomasz Kojm <
[email protected]
>; 2006, Sensory Networks, Inc; 2007-2015, Cisco Systems, Inc; 2014-2018, Cisco and/or its affiliates
debian/copyright
1
use std::ffi::{OsStr, OsString};
2
3
pub(crate) fn os_to_wide(s: &OsStr) -> Vec<u16> {
4
s.to_string_lossy().encode_utf16().collect()
5
}
6
7
pub(crate) fn os_from_wide(s: &[u16]) -> OsString {
8
OsString::from(String::from_utf16_lossy(s))
9
}