Skip to main content

char_width

Function char_width 

Source
pub fn char_width(ch: char) -> usize
Expand description

Display width of a Unicode character for terminal rendering.

Returns: 0 — combining/zero-width character; caller appends to previous cell 1 — normal single-column character 2 — wide character (CJK ideograph, some emoji); occupies two columns

Characters with unknown width (e.g. private-use) are treated as width 1.