Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

6.6.3 Wide Characters

Some of the inconvenience of handling multibyte characters would be eliminated if all characters were of a uniform number of bytes or bits. Because such a character set can contain thousands or tens of thousands of ideograms, a 16-bit or 32-bit sized integer value should be used to hold all members. (The full Chinese alphabet includes more than 65,000 ideograms!) ISO C includes the typedef name wchar_t as the implementation-defined integer type large enough to hold all members of the extended character set.

Each wide character has a corresponding multibyte character, and vice versa. The wide character that corresponds to a regular single-byte character is required to have the same value as its single-byte value, including the null character. However, the macro EOF might not necessarily be stored in a wchar_t, just as EOF might not be representable as a char.