Wide character
A wide character is a value of type wchar_t representing one character from an extended character set.
Modern C
A wide character is a C character representation of type wchar_t intended to encode one character of an extended character set.
- How it is used
- Uses wide characters to count and process characters represented by multibyte strings.
- How deep it goes
- Works through conversion and state-aware helper implementations, while deferring broader treatment of wchar_t.
- Examples
- Shows separator-width calculation, a wide-string duplication helper, and a character-search helper.
- What you can do after
- Build it from scratch using mbsrtowcs to allocate and fill a wide-character copy of a multibyte string.
Modern C, Third Edition
A wide character is a value of type wchar_t that represents exactly one character from an extended character set.
- How it is used
- Handles individual characters when multibyte strings require parsing, conversion, or character-oriented processing.
- How deep it goes
- Explains wchar_t, conversion functions, parsing state, locale dependence, and implementation portability checks.
- Examples
- Uses mbsrtowcs, mbrtowc, locale switching, and Unicode box-drawing character literals.
- What you can do after
- Apply mbsrtowcs and mbrtowc to convert multibyte input into wchar_t values while tracking parsing state.
Related concepts
- mbrtowcproduced by · mbrtowc is a C standard-library function that converts a multibyte character sequence to a wide character while maintaining restartable conversion state.
- wide character stringpart of · A wide-character string is a null-terminated array of wchar_t values representing a sequence of wide characters.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

