https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124616
--- Comment #10 from Steve Kargl <kargl at gcc dot gnu.org> ---
James, iconv on FreeBSD uses UTF-32LE instead of UTF32LE.
With the diff at the end of this message, I see
=== cobol Summary ===
# of expected passes 6886
# of unexpected failures 186
# of expected failures 78
# of unresolved testcases 36
/usr/home/sgk/gcc/objx/gcc/gcobol version 16.0.1 20260323 (experimental) (GCC)
which seems to fix 350 or so failures I previous saw. The
diff uses a test for __FreeBSD__. It may be better to have
a configure tests to set HAVE_UTF_32LE and/or HAVE_UTF32LE.
diff --git a/libgcobol/charmaps.h b/libgcobol/charmaps.h
index c8fa82264d1..0e17525a7c7 100644
--- a/libgcobol/charmaps.h
+++ b/libgcobol/charmaps.h
@@ -302,7 +302,11 @@ char * __gg__miconverter(cbl_encoding_t from,
#define DEFAULT_SOURCE_ENCODING (iconv_CP1252_e)
+#if __FreeBSD__
+#define DEFAULT_32_ENCODING (iconv_UTF_32LE_e)
+#else
#define DEFAULT_32_ENCODING (iconv_UTF32LE_e)
+#endif
class charmap_t;