Name

iswprint

Synopsis

Ascertains whether a given wide character is printable

#include <wctype.h>
intiswprint( wint_t wc );

The iswprint() function is the wide-character version of the isprint() character classification function. It tests whether its argument is a printing character. If the argument is a printing wide character, iswprint() returns a nonzero value (that is, true); if not, the function returns 0 (false).

“Printing” means only that the character occupies printing space on the output medium, not that it fills the space with a glyph. In other words, iswprint() may return true for locale-specific whitespace characters, as well as for the space character, L' '.

Which character codes represent printable characters depends on the current locale setting for the category LC_CTYPE, which you can query or change using the setlocale() function.

Example

See the example for iswalpha() in this chapter.

See Also

iswspace(); the corresponding function for byte characters, isprint(); iswalnum(), iswalpha(), iswblank(), iswcntrl(), iswdigit(), iswlower(), iswpunct(), iswupper(), iswxdigit(), setlocale(); the extensible wide-character classification function, iswctype()

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.