#![allow(unused_variables)] #![feature(str_from_utf16_endian)] fn main() { let v = &[ 0x34, 0xD8, 0x1E, 0xDD, 0x6d, 0x00, 0x75, 0x00, 0x73, 0x00, 0x69, 0x00, 0x63, 0x00, ]; assert_eq!(String::from("𝄞music"), String::from_utf16le(v).unwrap()); let v = &[ 0x34, 0xD8, 0x1E, 0xDD, 0x6d, 0x00, 0x75, 0x00, 0x00, 0xD8, 0x69, 0x00, 0x63, 0x00, ]; assert!(String::from_utf16le(v).is_err()); }