| 1 |
'\" t |
| 2 |
.\" Copyright, Bruno Haible <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
.\" |
| 7 |
.TH wcslen 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
wcslen \- determine the length of a wide-character string |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <wchar.h> |
| 16 |
.P |
| 17 |
.BI "size_t wcslen(const wchar_t *" s ); |
| 18 |
.fi |
| 19 |
.SH DESCRIPTION |
| 20 |
The |
| 21 |
.BR wcslen () |
| 22 |
function is the wide-character equivalent |
| 23 |
of the |
| 24 |
.BR strlen (3) |
| 25 |
function. |
| 26 |
It determines the length of the wide-character string pointed to |
| 27 |
by |
| 28 |
.IR s , |
| 29 |
excluding the terminating null wide character (L\[aq]\[rs]0\[aq]). |
| 30 |
.SH RETURN VALUE |
| 31 |
The |
| 32 |
.BR wcslen () |
| 33 |
function returns the |
| 34 |
number of wide characters in |
| 35 |
.IR s . |
| 36 |
.SH ATTRIBUTES |
| 37 |
For an explanation of the terms used in this section, see |
| 38 |
.BR attributes (7). |
| 39 |
.TS |
| 40 |
allbox; |
| 41 |
lbx lb lb |
| 42 |
l l l. |
| 43 |
Interface Attribute Value |
| 44 |
T{ |
| 45 |
.na |
| 46 |
.nh |
| 47 |
.BR wcslen () |
| 48 |
T} Thread safety MT-Safe |
| 49 |
.TE |
| 50 |
.SH STANDARDS |
| 51 |
C11, POSIX.1-2008. |
| 52 |
.SH HISTORY |
| 53 |
POSIX.1-2001, C99. |
| 54 |
.SH NOTES |
| 55 |
In cases where the input buffer may not contain |
| 56 |
a terminating null wide character, |
| 57 |
.BR wcsnlen (3) |
| 58 |
should be used instead. |
| 59 |
.SH SEE ALSO |
| 60 |
.BR strlen (3) |