pub fn text_trim(text: &str, nbytes: usize) -> StringExpand description
Trim text so its UTF-8 encoded size does not exceed nbytes.
Finds the largest valid UTF-8 prefix within nbytes, then strips
leading/trailing whitespace from the result. Multi-byte characters
that would be split are dropped entirely.