utf8 to utf16 conversion functions useable in const contexts.
const HELLO_WORLD_UTF16: &[u16]= const_utf16::encode!("Hello, world!");
This crate requires Rust 1.46.0 or newer due to the use of some const expression features.
This code is largely inspired by the Rust core utf16 conversion code.