1WCWIDTH(3) Linux Programmer's Manual WCWIDTH(3)
2
3
4
6 wcwidth - determine columns needed for a wide character
7
9 #define _XOPEN_SOURCE /* See feature_test_macros(7) */
10 #include <wchar.h>
11
12 int wcwidth(wchar_t c);
13
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
21 The wcwidth() function returns the number of column positions for c.
22
24 For an explanation of the terms used in this section, see at‐
25 tributes(7).
26
27 ┌──────────┬───────────────┬────────────────┐
28 │Interface │ Attribute │ Value │
29 ├──────────┼───────────────┼────────────────┤
30 │wcwidth() │ Thread safety │ MT-Safe locale │
31 └──────────┴───────────────┴────────────────┘
33 POSIX.1-2001, POSIX.1-2008.
34
35 Note that glibc before 2.2.5 used the prototype
36
37 int wcwidth(wint_t c);
38
40 The behavior of wcwidth() depends on the LC_CTYPE category of the cur‐
41 rent locale.
42
44 iswprint(3), wcswidth(3)
45
47 This page is part of release 5.10 of the Linux man-pages project. A
48 description of the project, information about reporting bugs, and the
49 latest version of this page, can be found at
50 https://www.kernel.org/doc/man-pages/.
51
52
53
54GNU 2019-03-06 WCWIDTH(3)