In Cygwin 3.5.3, the attached program has an assertion failure in line 24: bytes is not (size_t)-2. How to reproduce: $ gcc -Wall foo.c $ ./a I think this is a bug, because - ISO C 23 § 7.30.1.5 talks about "completing" a character, not "representing" an (entire) character. - The test passes on glibc, musl libc, FreeBSD 14.0, Solaris 11.4. Bruno