Section: Linux Programmer's Manual (3)
Return to Main Contents
mbrlen - determine number of bytes in next multibyte character
size_t mbrlen(const char *s, size_t n, mbstate_t *ps);
function inspects at most
bytes of the multibyte
string starting at
and extracts the next complete multibyte character.
It updates the shift state
If the multibyte character is not the
null wide character, it returns the number of bytes that were consumed from
If the multibyte character is the null wide character, it resets the
to the initial state and returns 0.
bytes starting at
do not contain a complete multibyte
This can happen even if
if the multibyte string contains redundant shift
If the multibyte string starting at
contains an invalid multibyte
sequence before the next complete character,
In this case,
the effects on
is a NULL pointer, a static anonymous state known only to the
function is used instead.
function returns the number of bytes
parsed from the multibyte
sequence starting at
if a non-null wide character was recognized.
It returns 0, if a null wide character was recognized.
if an invalid multibyte sequence was
if it couldn't parse a complete multibyte
character, meaning that
should be increased.
Multithreading (see pthreads(7))
function is thread-safe with exceptions.
It is not thread-safe if called with a NULL ps parameter.
The behavior of
depends on the
category of the
This page is part of release 3.54 of the Linux
A description of the project,
and information about reporting bugs,
can be found at
- RETURN VALUE
- Multithreading (see pthreads(7))
- CONFORMING TO
- SEE ALSO
This document was created by
using the manual pages.
Time: 12:14:19 GMT, January 22, 2018