str_trunc

Truncate strings for display

Shortens strings to a maximum character width and appends an ellipsis when needed. Width is measured in characters (Unicode code points), so multi-byte UTF-8 strings are never split mid-character.