pub fn encode_utf8<I: IntoIterator<Item = char>>( iter: I, ) -> EncodeUtf8<I::IntoIter> ⓘ
Creates an iterator that encodes an iterator over chars into UTF-8 bytes.
char
use widestring::encode_utf8; let music = "𝄞music"; let encoded: Vec<u8> = encode_utf8(music.chars()).collect(); assert_eq!(encoded, music.as_bytes());