mbrtoc32
¶ISO C23 specification:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf section 7.30.1.5.
POSIX specification:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/mbrtoc32.html
Gnulib module: mbrtoc32 or mbrtoc32-regular
Portability problems fixed by either Gnulib module mbrtoc32
or mbrtoc32-regular
:
(size_t) -1
and set errno
to EILSEQ
:
glibc 2.35.
(size_t) -2
when the input
is empty:
glibc 2.19,
mingw,
Android 11,
Haiku.
mbrtowc
recognizes on some platforms:
FreeBSD 13.2,
Solaris 11.4, mingw, MSVC 14.
Portability problems fixed by Gnulib module mbrtoc32-regular
:
(size_t) -3
.
No known implementation currently (2023) behaves that way, but it may
theoretically happen.
With the mbrtoc32-regular
module, you have the guarantee that the
Gnulib-provided mbrtoc32
function maps each multibyte character to
exactly one Unicode character and thus never returns (size_t) -3
.
Portability problems not fixed by Gnulib:
Note: If you want the guarantee that the char32_t
values returned
by this function are Unicode code points, you also need to request the
uchar-h-c23
module.