Name

unicode_wcwidth, unicode_wcwidth_str — width of a Unicode character string

Synopsis

#include <courier-unicode.h>
int unicode_wcwidth( char32_t c);
 
size_t unicode_wcwidth_str( const char32_t *str);
 

DESCRIPTION

unicode_wcwidth returns 1 for regular Unicode characters, 0 for control characters, and 2 for characters that normally take up the width of two regular characters on a text console.

unicode_wcwidth_str adds up unicode_wcwidth of all characters in the null-terminated string and returns the total

BUGS

The width of a Unicode character is looked up in the Unicode database, and not your terminal's character set font. Hopefully your terminal's character set font is Unicide-compatible.