Wide Character Support

Supporting larger character sets is an important aspect of internationalizing C. C9X provides for a wchar_t type and a host of related functions for dealing with larger character sets.

The stddef.h header file defines wchar_t as an integer type; the exact type is implementation dependent. Its intended use is to hold characters from an extended character set that is a superset of the basic character set. By definition, the char type is sufficient to handle the basic character set. The wchar_t type may need more bits to handle a greater range of code values. For example, char might be an 8-bit byte and wchar_t might be a 16-bit unsigned short.

Wide-character constants and string literals are indicated with an L prefix, and ...

Get C Primer Plus®, Third Edition 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.