Macro widestring::u16cstr
source · macro_rules! u16cstr { ($text:expr) => { ... }; }
Expand description
Converts a string literal into a const
UTF-16 string slice of type
U16CStr
.
The resulting const
string slice will always be valid UTF-16 and include a nul terminator.
§Examples
use widestring::{u16cstr, U16CStr, U16CString};
const STRING: &U16CStr = u16cstr!("My string");
assert_eq!(U16CString::from_str("My string").unwrap(), STRING);