# **[](https://en.cppreference.com/w/c/header/wctype)** provides wide-character classification (`iswalpha`, `iswdigit`, `iswspace`) and case conversion (`towupper`, `towlower`). These functions work on full Unicode via `wchar_t`, unlike `` which handles only ASCII. Results depend on locale; call `setlocale(LC_ALL, "")` for correct Unicode support. ## Example This example classifies and case-converts wide characters in a string. ```c // compile: gcc -o wctypeexample wctypeexample.c // run: ./wctypeexample // description: classify and case-convert wide characters #include #include #include int main() { setlocale(LC_ALL, ""); const wchar_t* s = L"héLLo 42!"; for (const wchar_t* p = s; *p; p++) { wprintf(L"'%lc' alpha=%d digit=%d upper=%d upper→%lc\n", *p, iswalpha(*p) != 0, iswdigit(*p) != 0, iswupper(*p) != 0, towupper(*p)); } return 0; } ``` ## Common functions **Character classification** (return non-zero if true): - `iswalpha(c)`: letter - `iswdigit(c)`: decimal digit - `iswalnum(c)`: alphanumeric - `iswspace(c)`: whitespace - `iswpunct(c)`: punctuation - `iswprint(c)`: printable - `iswcntrl(c)`: control character - `iswupper(c)`: uppercase - `iswlower(c)`: lowercase - `iswxdigit(c)`: hex digit **Case conversion**: - `towupper(c)`: convert to uppercase - `towlower(c)`: convert to lowercase - `towctrans(c, trans)`: apply locale-specific transform **Locale-specific classification**: - `wctype(name)`: get character class by name - `iswctype(c, type)`: test membership in class