wcslen(3)
π wcslen(3) β bestie, let's count some wide characters π
okay so this is the wcslen page from the library functions manual and honestly? she's a little icon. tiny function, big main character energy. let's get into it π«Ά
β¨ NAME β¨
wcslen β figure out how long a wide-character string is πΈ
π LIBRARY π
Standard C library (libc, -lc) π
π SYNOPSIS π
#include <wchar.h>
size_t wcslen(const wchar_t *s);
π¦ DESCRIPTION π¦
So. wcslen() is the wide-character glow-up of strlen(3) β literally the same vibe, just built for wide characters instead of plain ones. no cap.
What she does: she determines the length of the wide-character string that s is pointing at. and bestie, listen β she does not count the terminating null wide character, L'\0'. that one gets left out. she counts up to it and stops, like a respectful queen. π
π« RETURN VALUE π«
wcslen() returns the number of wide characters in s. that's it. that's the whole answer. periodt. β¨
π₯ ATTRIBUTES π₯
ngl if you wanna know what all these terms even mean, go check out attributes(7) β she explains it properly.
wcslen()β Thread safety: MT-Safe π
fr fr, MT-Safe means she's safe to call from multiple threads at once, no drama π
π STANDARDS π
This baddie is standardized in C11 and POSIX.1-2008. ate. π
πΈ HISTORY πΈ
She's been around: POSIX.1-2001, C99. iconic since forever. π
β NOTES β
okay this part actually matters so pay attention bestie π
If there's a chance your input buffer does not contain a terminating null wide character, you should be using wcsnlen(3) instead. like, do not just rawdog wcslen() on a buffer that might not be null-terminated. she will keep walking and walking and walking and it's giving undefined behavior π
π«Ά SEE ALSO π«Ά
and that's the page!! <rainbow>wcslen(3)</rainbow> came from Linux man-pages 6.20, dated 2026-02-08 β ty for the docs, slay, mwah πβ¨π¦
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms