Home

iswspace

iswspace is a wide-character classification function in the C standard library. It tests whether a given wide character is considered whitespace in the current locale. The function is declared in the header <wctype.h> and takes a wint_t argument, returning a nonzero value if the character is classified as whitespace, and zero otherwise.

The set of characters that count as whitespace is locale-dependent. In the default C locale it typically

Usage and portability: iswspace compares wide characters, so it is the wide-character counterpart to isspace. In

Notes: The argument wc should be a wide character value representable as a wint_t. Passing an invalid

includes
ASCII
whitespace
such
as
space,
horizontal
tab,
newline,
vertical
tab,
form
feed,
and
carriage
return.
In
other
locales,
additional
wide
characters
may
be
treated
as
whitespace,
depending
on
the
locale
data
loaded
for
LC_CTYPE.
C,
you
may
call
it
with
a
wchar_t
value
promoted
to
wint_t,
for
example
iswspace(L'
'),
iswspace(L'\n'),
or
iswspace(L'A').
In
C++,
the
equivalent
is
std::iswspace
in
the
header
<cwctype>
(often
used
within
the
std
namespace).
To
affect
locale-dependent
classification,
set
the
locale
with
setlocale(LC_CTYPE,
"")
or
another
locale
string
before
using
iswspace.
value
yields
unspecified
or
undefined
behavior
according
to
the
C
standard.
iswspace
is
widely
supported
across
modern
C
and
C++
standard
libraries.