static int utf8_byte_len(unsigned char c)
Return the length in bytes of an UTF-8 character.
char * truncate_line(const char *line, int max_width)
Copy up to max_width visible characters into a static buffer.
int visual_strlen(const char *s)
Calculate the visual display width of a UTF-8 string in terminal cols.