2 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\" References consulted:
7 .\" GNU glibc-2 source code and manual
8 .\" Dinkumware C library reference http://www.dinkumware.com/
9 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
12 .TH mbrlen 3 (date) "Linux man-pages (unreleased)"
14 mbrlen \- determine number of bytes in next multibyte character
17 .RI ( libc ", " \-lc )
22 .BI "size_t mbrlen(const char " s "[restrict ." n "], size_t " n ,
23 .BI " mbstate_t *restrict " ps );
28 function inspects at most
30 bytes of the multibyte
33 and extracts the next complete multibyte character.
34 It updates the shift state
36 If the multibyte character is not the
37 null wide character, it returns the number of bytes that were consumed from
39 If the multibyte character is the null wide character, it resets the
42 to the initial state and returns 0.
48 do not contain a complete multibyte
53 This can happen even if
57 if the multibyte string contains redundant shift
60 If the multibyte string starting at
62 contains an invalid multibyte
63 sequence before the next complete character,
78 is NULL, a static anonymous state known only to the
80 function is used instead.
84 function returns the number of bytes
85 parsed from the multibyte
88 if a non-null wide character was recognized.
89 It returns 0, if a null wide character was recognized.
96 if an invalid multibyte sequence was
100 if it couldn't parse a complete multibyte
101 character, meaning that
105 For an explanation of the terms used in this section, see
113 Interface Attribute Value
116 T} Thread safety MT-Unsafe race:mbrlen/!ps
122 POSIX.1-2001, POSIX.1-2008, C99.