pub fn truncate_utf8_to_max_bytes(value: &str, max_bytes: usize) -> StringExpand description
Truncates a string to at most max_bytes bytes without splitting a UTF-8 code point.
If value is already within the limit it is returned unchanged as an owned string. A zero limit
always returns an empty string.