Skip to main content

max_line_length_utf8

Function max_line_length_utf8 

Source
pub fn max_line_length_utf8(data: &[u8]) -> u64
Expand description

Compute maximum display width of any line (UTF-8 locale).

GNU wc -L in UTF-8 locale uses mbrtowc() + wcwidth() for display width. East Asian Wide/Fullwidth characters get width 2, most others get width 1.

Optimized with printable ASCII run counting for common text.