1wcswidth(3)                Library Functions Manual                wcswidth(3)
2
3
4

NAME

6       wcswidth  -  determine  columns  needed for a fixed-size wide-character
7       string
8

LIBRARY

10       Standard C library (libc, -lc)
11

SYNOPSIS

13       #define _XOPEN_SOURCE             /* See feature_test_macros(7) */
14       #include <wchar.h>
15
16       int wcswidth(const wchar_t *s, size_t n);
17

DESCRIPTION

19       The wcswidth() function returns the number of columns needed to  repre‐
20       sent  the  wide-character  string  pointed  to by s, but at most n wide
21       characters.  If a nonprintable wide character occurs among these  char‐
22       acters, -1 is returned.
23

RETURN VALUE

25       The  wcswidth() function returns the number of column positions for the
26       wide-character string s, truncated to at most length n.
27

ATTRIBUTES

29       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
30       tributes(7).
31
32       ┌─────────────────────────────────────┬───────────────┬────────────────┐
33Interface                            Attribute     Value          
34       ├─────────────────────────────────────┼───────────────┼────────────────┤
35wcswidth()                           │ Thread safety │ MT-Safe locale │
36       └─────────────────────────────────────┴───────────────┴────────────────┘
37

STANDARDS

39       POSIX.1-2008.
40

HISTORY

42       POSIX.1-2001.
43

NOTES

45       The behavior of wcswidth() depends on the LC_CTYPE category of the cur‐
46       rent locale.
47

SEE ALSO

49       iswprint(3), wcwidth(3)
50
51
52
53Linux man-pages 6.04              2023-03-30                       wcswidth(3)
Impressum