liveBook · Manning

Mbrtowc

mbrtowc is a C standard-library function that converts a multibyte character sequence to a wide character while maintaining restartable conversion state.

How 2 Manning books explain it

Modern C

mbrtowc is a C standard library function that converts one multibyte character to a wide character while tracking conversion state.

How it is used
Supports character-by-character conversion while scanning multibyte strings.
How deep it goes
Explains the byte limit, conversion state, and key return values through a wrapper; leaves encoding details machine-dependent.
Examples
Traces a wrapper that enlarges the byte limit after -2 and feeds a wide-character string search.
What you can do after
Apply it to convert successive multibyte characters, handling insufficient input separately from encoding errors.

Read how Modern C explains mbrtowc →

Modern C, Third Edition

mbrtowc is a C standard-library conversion function that converts a multibyte character sequence to a wide character while maintaining restartable conversion state.

How it is used
Parses one multibyte character when conversion requires finer control than whole-string conversion.
How deep it goes
Explains the signature, scan limit, incomplete result, and adaptive-length wrapper without detailing encoding algorithms.
Examples
Uses a mbrtow wrapper that retries with increasing limits and reports mbinvalid after conversion failure.
What you can do after
Apply mbrtowc to inspect multibyte input incrementally and respond to incomplete or invalid characters.

Read how Modern C, Third Edition explains mbrtowc →

Related concepts

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.