pub fn from_utf16(s: &[u16]) -> String {
    use std::os::windows::ffi::OsStringExt;

    let null_index = s.iter().position(|&i| i==0).unwrap_or(s.len());
    let os_string = OsString::from_wide(&s[0..null_index]);

    os_string.into_string().unwrap_or("Decoding error".to_string())
}
/**
    Decode a raw utf16 string. Should be null terminated.
*/
Decode a raw utf16 string. Should be null terminated.
Decode a raw utf16 string . Should be null terminated .
pub fn from_utf16(s: &[u16]) -> String {
    use std::os::windows::ffi::OsStringExt;
    let null_index = s.iter().position(|&i| i==0).unwrap_or(s.len());
    let os_string = OsString::from_wide(&s[0..null_index]);
    os_string.into_string().unwrap_or("Decoding error".to_string())
}
pub fn from_utf16 ( s : & [ u16 ] ) -> String { use std :: os :: windows :: ffi :: OsStringExt ; let null_index = s . iter ( ) . position ( | & i | i == 0 ) . unwrap_or ( s . len ( ) ) ; let os_string = OsString :: from_wide ( & s [ 0 .. null_index ] ) ; os_string . into_string ( ) . unwrap_or ( " " . to_string ( ) ) }
Decode a raw utf16 string.
Decode a raw utf16 string .
s
&[u16]