┌──────────────────────────────────────────────────────────────────────┐ │The wide character testing functions starting with isw, are │ │wide-character versions of the character testing functions starting │ │with is. │ └──────────────────────────────────────────────────────────────────────┘
The C language has provided character testing functions such as the isprint() and the isalpha() functions. However, they can not be used to test DBCS characters since the argument accepts SBCS only (**).
The isw* functions accept wint_t instead of int, which should be a wide character plus a WEOF wide character. The functions are locale sensitive, so they can test classifications of DBCS characters as well as SBCS characters after converting to them wchar_t. In the Japanese locale, there are DBCS alphabetic characters as well as SBCS ones. The iswalpha() function returns TRUE for both SBCS and DBCS alphabets if the current locale is "ja_jp".
┌──────────────────────────────────────────────────────────────────────┐ │The towlower() and the towupper() functions are wide-character │ │versions of the tolower() and the toupper() functions. │ └──────────────────────────────────────────────────────────────────────┘
The tolower() and the toupper() functions supports SBCS characters only. Like the correspondence of the isxxx() functions and the iswxxx() functions, wide character versions, the towlower() and towupper() are available.
The characters classification referred by the iswxxx() and the towxxx() functions are defined in the LC_CTYPE category of a locale.
┌──────────────────────────────────────────────────────────────────────┐ │A useful extension of XPG4 is that it provides an interface to define │ │and test locale specific character classes. │ └──────────────────────────────────────────────────────────────────────┘
There may be unique character classes in each language in addition to the standard classes such as alpha and digit. For example, Korean has phonetic characters, "Hanguel", and Japanese has phonetic characters, "Katakana" and "Hiragana". XPG4 provides a method to describe such unique character classes in a locale database. The wctype() function is used to query the class name and the iswctype function is used to test a wide character.