1WCSWIDTH(3) Linux Programmer's Manual WCSWIDTH(3)
2
3
4
6 wcswidth - determine columns needed for a fixed-size wide-character
7 string
8
10 #define _XOPEN_SOURCE /* See feature_test_macros(7) */
11 #include <wchar.h>
12
13 int wcswidth(const wchar_t *s, size_t n);
14
16 The wcswidth() function returns the number of columns needed to repre‐
17 sent the wide-character string pointed to by s, but at most n wide
18 characters. If a nonprintable wide character occurs among these char‐
19 acters, -1 is returned.
20
22 The wcswidth() function returns the number of column positions for the
23 wide-character string s, truncated to at most length n.
24
26 For an explanation of the terms used in this section, see at‐
27 tributes(7).
28
29 ┌───────────┬───────────────┬────────────────┐
30 │Interface │ Attribute │ Value │
31 ├───────────┼───────────────┼────────────────┤
32 │wcswidth() │ Thread safety │ MT-Safe locale │
33 └───────────┴───────────────┴────────────────┘
35 POSIX.1-2001, POSIX.1-2008.
36
38 The behavior of wcswidth() depends on the LC_CTYPE category of the cur‐
39 rent locale.
40
42 iswprint(3), wcwidth(3)
43
45 This page is part of release 5.10 of the Linux man-pages project. A
46 description of the project, information about reporting bugs, and the
47 latest version of this page, can be found at
48 https://www.kernel.org/doc/man-pages/.
49
50
51
52GNU 2015-08-08 WCSWIDTH(3)