liveBook · Manning

Mbsrtowcs

mbsrtowcs is a C standard-library function that converts a restartable multibyte character string to a wide-character string.

How 2 Manning books explain it

Modern C

mbsrtowcs is a C standard library function that converts a restartable multibyte string to a wide-character string.

How it is used
Converts multibyte strings for character counting and wide-character string processing.
How deep it goes
Shows counting and allocation calls, including conversion-state copies and error checks, without implementing the library function itself.
Examples
Uses mbsrlen to count characters and mbsrdup to allocate and fill a wide-character string.
What you can do after
Apply it via the C standard library to count multibyte-string characters and populate an allocated wide-character string.

Read how Modern C explains mbsrtowcs →

Modern C, Third Edition

mbsrtowcs is a C standard-library function that converts a multibyte string to a wide character string while maintaining conversion state.

How it is used
Converts multibyte strings into wide character strings for extended-character processing.
How deep it goes
Explains the interface, state handling, length-query idiom, allocation pattern, and invalid-source handling without detailing implementation internals.
Examples
Demonstrates zero-length counting through mbsrlen and allocated conversion through mbsrdup.
What you can do after
Build converted wide strings and determine their required length while preserving conversion state.

Read how Modern C, Third Edition explains mbsrtowcs →

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.