1WCWIDTH(3)                 Linux Programmer's Manual                WCWIDTH(3)
2
3
4

NAME

6       wcwidth - determine columns needed for a wide character
7

SYNOPSIS

9       #define _XOPEN_SOURCE       /* See feature_test_macros(7) */
10       #include <wchar.h>
11
12       int wcwidth(wchar_t c);
13

DESCRIPTION

15       The  wcwidth()  function returns the number of columns needed to repre‐
16       sent the wide character c.  If c is a  printable  wide  character,  the
17       value is at least 0.  If c is null wide character (L'\0'), the value is
18       0.  Otherwise, -1 is returned.
19

RETURN VALUE

21       The wcwidth() function returns the number of column positions for c.
22

ATTRIBUTES

24       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
25       tributes(7).
26
27       ┌─────────────────────────────────────┬───────────────┬────────────────┐
28Interface                            Attribute     Value          
29       ├─────────────────────────────────────┼───────────────┼────────────────┤
30wcwidth()                            │ Thread safety │ MT-Safe locale │
31       └─────────────────────────────────────┴───────────────┴────────────────┘
32

CONFORMING TO

34       POSIX.1-2001, POSIX.1-2008.
35
36       Note that glibc before 2.2.5 used the prototype
37
38       int wcwidth(wint_t c);
39

NOTES

41       The  behavior of wcwidth() depends on the LC_CTYPE category of the cur‐
42       rent locale.
43

SEE ALSO

45       iswprint(3), wcswidth(3)
46

COLOPHON

48       This page is part of release 5.13 of the Linux  man-pages  project.   A
49       description  of  the project, information about reporting bugs, and the
50       latest    version    of    this    page,    can     be     found     at
51       https://www.kernel.org/doc/man-pages/.
52
53
54
55GNU                               2021-03-22                        WCWIDTH(3)
Impressum