1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\" References consulted:
6 .\" GNU glibc-2 source code and manual
7 .\" Dinkumware C library reference http://www.dinkumware.com/
8 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
11 .TH mbrlen 3 (date) "Linux man-pages (unreleased)"
13 mbrlen \- determine number of bytes in next multibyte character
16 .RI ( libc ", " \-lc )
21 .BI "size_t mbrlen(const char *restrict " s ", size_t " n ,
22 .BI " mbstate_t *restrict " ps );
27 function inspects at most
29 bytes of the multibyte
32 and extracts the next complete multibyte character.
33 It updates the shift state
35 If the multibyte character is not the
36 null wide character, it returns the number of bytes that were consumed from
38 If the multibyte character is the null wide character, it resets the
41 to the initial state and returns 0.
47 do not contain a complete multibyte
52 This can happen even if
56 if the multibyte string contains redundant shift
59 If the multibyte string starting at
61 contains an invalid multibyte
62 sequence before the next complete character,
77 is NULL, a static anonymous state known only to the
79 function is used instead.
83 function returns the number of bytes
84 parsed from the multibyte
87 if a non-null wide character was recognized.
88 It returns 0, if a null wide character was recognized.
95 if an invalid multibyte sequence was
99 if it couldn't parse a complete multibyte
100 character, meaning that
104 For an explanation of the terms used in this section, see
112 Interface Attribute Value
115 T} Thread safety MT-Unsafe race:mbrlen/!ps
121 POSIX.1-2001, POSIX.1-2008, C99.