pub fn string_len(string: &str) -> usize
Calculates the encoded length of a string (compatibility function)