Home

iswxdigit

iswxdigit is a function from the C standard library that tests whether a given wide character represents a hexadecimal digit. It is declared in the header <wchar.h> and has the prototype int iswxdigit(wint_t wc). To use it, include <wchar.h> and pass a wide character value (of type wint_t), such as a wide character literal like L'A' or a value returned by towc.

The function returns a nonzero value if wc is a hexadecimal digit, and zero otherwise. The classification

Usage and purpose: iswxdigit is used to validate or parse hexadecimal input in programs that process wide-character

Portability and notes: iswxdigit is part of the standard library interfaces for wide characters and is available

is
locale-dependent:
in
the
default
C
locale,
the
recognized
hex
digits
are
the
ASCII
characters
0–9,
A–F,
and
a–f.
In
non-C
locales,
the
set
of
hex
digits
may
include
additional
wide
characters
defined
as
hexadecimal
digits
by
the
current
locale’s
LC_CTYPE
category.
As
with
other
wide-character
classification
functions,
the
exact
behavior
for
non-ASCII
characters
depends
on
the
implementation
and
locale.
strings.
It
serves
as
the
wide-character
equivalent
of
isxdigit
for
narrow
characters
and
is
often
used
in
conjunction
with
other
wide-character
classification
routines
such
as
iswdigit
or
iswalpha.
on
platforms
that
implement
<wchar.h>,
including
many
Unix-like
systems
and
Windows.
When
writing
portable
code,
be
mindful
of
locale
settings,
as
the
result
may
vary
with
LC_CTYPE.
It
expects
a
wint_t
input;
passing
WEOF
is
not
meaningful
for
this
function.
See
also
isxdigit
and
iswdigit.