1WCSWIDTH(3P) POSIX Programmer's Manual WCSWIDTH(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 wcswidth — number of column positions of a wide-character string
13
15 #include <wchar.h>
16
17 int wcswidth(const wchar_t *pwcs, size_t n);
18
20 The wcswidth() function shall determine the number of column positions
21 required for n wide-character codes (or fewer than n wide-character
22 codes if a null wide-character code is encountered before n wide-char‐
23 acter codes are exhausted) in the string pointed to by pwcs.
24
26 The wcswidth() function either shall return 0 (if pwcs points to a null
27 wide-character code), or return the number of column positions to be
28 occupied by the wide-character string pointed to by pwcs, or return -1
29 (if any of the first n wide-character codes in the wide-character
30 string pointed to by pwcs is not a printable wide-character code).
31
33 No errors are defined.
34
35 The following sections are informative.
36
38 None.
39
41 This function was removed from the final ISO/IEC 9899:1990/Amendment
42 1:1995 (E), and the return value for a non-printable wide character is
43 not specified.
44
46 None.
47
49 None.
50
52 wcwidth()
53
54 The Base Definitions volume of POSIX.1‐2017, Section 3.103, Column
55 Position, <wchar.h>
56
58 Portions of this text are reprinted and reproduced in electronic form
59 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
60 table Operating System Interface (POSIX), The Open Group Base Specifi‐
61 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
62 Electrical and Electronics Engineers, Inc and The Open Group. In the
63 event of any discrepancy between this version and the original IEEE and
64 The Open Group Standard, the original IEEE and The Open Group Standard
65 is the referee document. The original Standard can be obtained online
66 at http://www.opengroup.org/unix/online.html .
67
68 Any typographical or formatting errors that appear in this page are
69 most likely to have been introduced during the conversion of the source
70 files to man page format. To report such errors, see https://www.ker‐
71 nel.org/doc/man-pages/reporting_bugs.html .
72
73
74
75IEEE/The Open Group 2017 WCSWIDTH(3P)