pub fn encode_to_string(input: &[u8], output: &mut String) -> usize
Expand description
Encode the given input, and append the result to output
. Returns
the number of bytes / characters appended (only ASCII characters are
appended).
ยงExample
let mut output = String::new();
let count = tick_encoding::encode_to_string("hello, world! ๐".as_bytes(), &mut output);
assert_eq!(output, "hello, world! `F0`9F`99`82");
assert_eq!(count, 26);