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

NAME

6       wcwidth - determine columns needed for a wide character
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #define _XOPEN_SOURCE       /* See feature_test_macros(7) */
13       #include <wchar.h>
14
15       int wcwidth(wchar_t c);
16

DESCRIPTION

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

RETURN VALUE

24       The wcwidth() function returns the number of column positions for c.
25

ATTRIBUTES

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

STANDARDS

37       POSIX.1-2008.
38

HISTORY

40       POSIX.1-2001.
41
42       Note that before glibc 2.2.5, glibc used the prototype
43
44       int wcwidth(wint_t c);
45

NOTES

47       The  behavior  of  wcwidth()  depends  on  the LC_CTYPE category of the
48       current locale.
49

SEE ALSO

51       iswprint(3), wcswidth(3)
52
53
54
55Linux man-pages 6.05              2023-07-20                        wcwidth(3)
Impressum