WCSWIDTH(3) Library Functions Manual WCSWIDTH(3)

wcswidthnumber of column positions of a wide-character string

#include <wchar.h>

int wcswidth(const wchar_t *pwcs, size_t n);

The wcswidth() function determines the number of column positions required for n wide-character codes (or fewer than n wide-character codes if a null wide-character code is encountered before n wide-character codes are exhausted) in the string pointed to by pwcs .

The wcswidth() function either returns 0 (if pwcs points to a null wide-character code), or returns the number of column positions to be occupied by the wide-character string pointed to by pwcs , or returns -1 (if any of the first n wide-character codes in the wide-character string pointed to by pwcs is not a printing wide-character code).

No errors are defined.

None.

None.

None.

wcwidth(3) , <wchar.h> , the definition of Column Position in the XBD specification, Chapter 2 , Glossary .

Derived from the MSE working draft.

February 1997 posix.fail