1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
12 .\" Dinkumware C library reference http://www.dinkumware.com/
13 .\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
16 .TH MBRLEN 3 2021-03-22 "GNU" "Linux Programmer's Manual"
18 mbrlen \- determine number of bytes in next multibyte character
23 .BI "size_t mbrlen(const char *restrict " s ", size_t " n ,
24 .BI " mbstate_t *restrict " ps );
29 function inspects at most
31 bytes of the multibyte
34 and extracts the next complete multibyte character.
35 It updates the shift state
37 If the multibyte character is not the
38 null wide character, it returns the number of bytes that were consumed from
40 If the multibyte character is the null wide character, it resets the
43 to the initial state and returns 0.
49 do not contain a complete multibyte
54 This can happen even if
58 if the multibyte string contains redundant shift
61 If the multibyte string starting at
63 contains an invalid multibyte
64 sequence before the next complete character,
79 is NULL, a static anonymous state known only to the
81 function is used instead.
85 function returns the number of bytes
86 parsed from the multibyte
89 if a non-null wide character was recognized.
90 It returns 0, if a null wide character was recognized.
97 if an invalid multibyte sequence was
101 if it couldn't parse a complete multibyte
102 character, meaning that
106 For an explanation of the terms used in this section, see
114 Interface Attribute Value
117 T} Thread safety MT-Unsafe race:mbrlen/!ps
123 POSIX.1-2001, POSIX.1-2008, C99.