Add OS/2-dependent aliases. Support aliases available on OS/2, especially results of kLIBC nl_langinfo(CODESET). * Makefile.devel (all): Depend on lib/aliases_sysos2.h. (lib/aliases_sysos2.h lib/canonical_sysos2.h lib/canonical_local_sysos2.h): New rules. (lib/aliases_os2.h lib/canonical_os2.h): New rules. (lib/aliases_os2_sysos2.h lib/canonical_os2_sysos2.h): New rules. (totally-clean): Remove lib/aliases_sysos2.gperf, lib/aliases_os2.h, lib/aliases_os2_sysos2.h, lib/canonical_sysos2.h, lib/canonical_os2.h, lib/canonical_os2_sysos2.h, lib/canonical_local_sysos2.h. * lib/Makefile.in (iconv.lo): Depend on $(srcdir)/aliases_sysos2.h, $(srcdir)/aliases_os2.h, $(srcdir)/aliases_os2_sysos2.h. (GENERATED_FILES): Add aliases_sysos2.gperf, aliases_sysos2.h, aliases_os2.h, aliases_os2_sysos2.h, canonical_sysos2.h, canonical_os2.h, canonical_os2_sysos2.h, canonical_local_sysos2.h. * lib/aliases2.h: Include headers for OS/2 aliases. * lib/encodings.def: Add DEFALIAS statements, conditional on USE_OS2_ALIASES. * lib/encodings_aix.def: Add DEFALIAS statements, conditional on USE_OS2_ALIASES. * lib/encodings_dos.def: Add DEFALIAS statements, conditional on USE_OS2_ALIASES. * lib/genaliases2.c (main): Include encodings_aix.def and encodings_dos.def for OS/2. * lib/genflags.c: Define USE_OS2. * lib/iconv.c: Define USE_OS2 if ENABLE_EXTRA, otherwise define USE_OS2, USE_AIX, USE_DOS on OS/2. (all_encodings): Include OS/2-dependent headers on OS/2 aliases. (aliases2_lookup): Define OS/2-dependent alias lookup table. (all_canonical): Include OS/2-dependent headers on OS/2 aliases.
diff --git a/.gitignore b/.gitignore index 606e1ec..c663699 100644 --- a/.gitignore +++ b/.gitignore
@@ -288,16 +288,20 @@ /lib/aliases_syshpux.gperf /lib/aliases_sysosf1.gperf /lib/aliases_syssolaris.gperf +/lib/aliases_sysos2.gperf /lib/aliases.h /lib/aliases_sysaix.h /lib/aliases_syshpux.h /lib/aliases_sysosf1.h /lib/aliases_syssolaris.h +/lib/aliases_sysos2.h /lib/aliases_aix.h /lib/aliases_aix_sysaix.h /lib/aliases_osf1.h /lib/aliases_osf1_sysosf1.h /lib/aliases_dos.h +/lib/aliases_os2.h +/lib/aliases_os2_sysos2.h /lib/aliases_zos.h /lib/aliases_extra.h /lib/canonical.h @@ -305,11 +309,14 @@ /lib/canonical_syshpux.h /lib/canonical_sysosf1.h /lib/canonical_syssolaris.h +/lib/canonical_sysos2.h /lib/canonical_aix.h /lib/canonical_aix_sysaix.h /lib/canonical_osf1.h /lib/canonical_osf1_sysosf1.h /lib/canonical_dos.h +/lib/canonical_os2.h +/lib/canonical_os2_sysos2.h /lib/canonical_zos.h /lib/canonical_extra.h /lib/canonical_local.h @@ -317,6 +324,7 @@ /lib/canonical_local_syshpux.h /lib/canonical_local_sysosf1.h /lib/canonical_local_syssolaris.h +/lib/canonical_local_sysos2.h /lib/flags.h /lib/translit.h /man/iconv.1.html
diff --git a/ChangeLog b/ChangeLog index 5f96055..6433a08 100644 --- a/ChangeLog +++ b/ChangeLog
@@ -1,3 +1,37 @@ +2026-03-06 KO Myung-Hun <komh78@gmail.com> + + Add OS/2-dependent aliases. + Support aliases available on OS/2, especially results of + kLIBC nl_langinfo(CODESET). + * Makefile.devel (all): Depend on lib/aliases_sysos2.h. + (lib/aliases_sysos2.h lib/canonical_sysos2.h + lib/canonical_local_sysos2.h): New rules. + (lib/aliases_os2.h lib/canonical_os2.h): New rules. + (lib/aliases_os2_sysos2.h lib/canonical_os2_sysos2.h): New rules. + (totally-clean): Remove lib/aliases_sysos2.gperf, lib/aliases_os2.h, + lib/aliases_os2_sysos2.h, lib/canonical_sysos2.h, lib/canonical_os2.h, + lib/canonical_os2_sysos2.h, lib/canonical_local_sysos2.h. + * lib/Makefile.in (iconv.lo): Depend on $(srcdir)/aliases_sysos2.h, + $(srcdir)/aliases_os2.h, $(srcdir)/aliases_os2_sysos2.h. + (GENERATED_FILES): Add aliases_sysos2.gperf, aliases_sysos2.h, + aliases_os2.h, aliases_os2_sysos2.h, canonical_sysos2.h, + canonical_os2.h, canonical_os2_sysos2.h, canonical_local_sysos2.h. + * lib/aliases2.h: Include headers for OS/2 aliases. + * lib/encodings.def: Add DEFALIAS statements, conditional on + USE_OS2_ALIASES. + * lib/encodings_aix.def: Add DEFALIAS statements, conditional on + USE_OS2_ALIASES. + * lib/encodings_dos.def: Add DEFALIAS statements, conditional on + USE_OS2_ALIASES. + * lib/genaliases2.c (main): Include encodings_aix.def and + encodings_dos.def for OS/2. + * lib/genflags.c: Define USE_OS2. + * lib/iconv.c: Define USE_OS2 if ENABLE_EXTRA, otherwise define USE_OS2, + USE_AIX, USE_DOS on OS/2. + (all_encodings): Include OS/2-dependent headers on OS/2 aliases. + (aliases2_lookup): Define OS/2-dependent alias lookup table. + (all_canonical): Include OS/2-dependent headers on OS/2 aliases. + 2025-12-26 Collin Funk <collin.funk1@gmail.com> (tiny change) Update after relocatable-lib change in gnulib on 2025-12-09.
diff --git a/Makefile.devel b/Makefile.devel index 90710c5..4d636db 100644 --- a/Makefile.devel +++ b/Makefile.devel
@@ -44,10 +44,11 @@ all : srclib/Makefile.in \ configures config.h.in \ include/iconv.h.build.in \ - lib/aliases.h lib/aliases_sysaix.h lib/aliases_syshpux.h lib/aliases_sysosf1.h lib/aliases_syssolaris.h \ + lib/aliases.h lib/aliases_sysaix.h lib/aliases_syshpux.h lib/aliases_sysosf1.h lib/aliases_syssolaris.h lib/aliases_sysos2.h \ lib/aliases_aix.h lib/aliases_aix_sysaix.h \ lib/aliases_osf1.h lib/aliases_osf1_sysosf1.h \ lib/aliases_dos.h \ + lib/aliases_os2.h lib/aliases_os2_sysos2.h \ lib/aliases_zos.h \ lib/aliases_extra.h \ lib/flags.h lib/translit.h \ @@ -192,6 +193,16 @@ sh canonical_local.sh > lib/canonical_local_syssolaris.h $(RM) tmp.h canonical.sh canonical_local.sh +lib/aliases_sysos2.h lib/canonical_sysos2.h lib/canonical_local_sysos2.h : lib/encodings.def lib/encodings_local.def lib/genaliases.c + $(CC) $(CFLAGS) -DUSE_OS2_ALIASES lib/genaliases.c -o genaliases + ./genaliases lib/aliases_sysos2.gperf canonical.sh canonical_local.sh + $(RM) genaliases + $(GPERF) -m 10 lib/aliases_sysos2.gperf > tmp.h + sed -e 's/^\(const struct alias \)/static \1/' < tmp.h > lib/aliases_sysos2.h + sh canonical.sh > lib/canonical_sysos2.h + sh canonical_local.sh > lib/canonical_local_sysos2.h + $(RM) tmp.h canonical.sh canonical_local.sh + lib/aliases_aix.h lib/canonical_aix.h : lib/encodings_aix.def lib/genaliases2.c $(CC) $(CFLAGS) -DUSE_AIX lib/genaliases2.c -o genaliases ./genaliases aix lib/aliases_aix.h lib/canonical_aix.h @@ -217,6 +228,16 @@ ./genaliases dos lib/aliases_dos.h lib/canonical_dos.h $(RM) genaliases +lib/aliases_os2.h lib/canonical_os2.h : lib/encodings_aix.def lib/encodings_dos.def lib/genaliases2.c + $(CC) $(CFLAGS) -DUSE_OS2 lib/genaliases2.c -o genaliases + ./genaliases os2 lib/aliases_os2.h lib/canonical_os2.h + $(RM) genaliases + +lib/aliases_os2_sysos2.h lib/canonical_os2_sysos2.h : lib/encodings_aix.def lib/encodings_dos.def lib/genaliases2.c + $(CC) $(CFLAGS) -DUSE_OS2 -DUSE_OS2_ALIASES lib/genaliases2.c -o genaliases + ./genaliases os2 lib/aliases_os2_sysos2.h lib/canonical_os2_sysos2.h + $(RM) genaliases + lib/aliases_zos.h lib/canonical_zos.h : lib/encodings_zos.def lib/genaliases2.c $(CC) $(CFLAGS) -DUSE_ZOS lib/genaliases2.c -o genaliases ./genaliases zos lib/aliases_zos.h lib/canonical_zos.h @@ -258,20 +279,22 @@ totally-clean : force rm -f srclib/Makefile.in rm -f aclocal.m4 $(CONFIGURES) config.h.in include/iconv.h.build.in - rm -f lib/aliases.gperf lib/aliases_sysaix.gperf lib/aliases_syshpux.gperf lib/aliases_sysosf1.gperf lib/aliases_syssolaris.gperf - rm -f lib/aliases.h lib/aliases_sysaix.h lib/aliases_syshpux.h lib/aliases_sysosf1.h lib/aliases_syssolaris.h + rm -f lib/aliases.gperf lib/aliases_sysaix.gperf lib/aliases_syshpux.gperf lib/aliases_sysosf1.gperf lib/aliases_syssolaris.gperf lib/aliases_sysos2.gperf + rm -f lib/aliases.h lib/aliases_sysaix.h lib/aliases_syshpux.h lib/aliases_sysosf1.h lib/aliases_syssolaris.h lib/aliases_sysos2.h rm -f lib/aliases_aix.h lib/aliases_aix_sysaix.h rm -f lib/aliases_osf1.h lib/aliases_osf1_sysosf1.h rm -f lib/aliases_dos.h + rm -f lib/aliases_os2.h lib/aliases_os2_sysos2.h rm -f lib/aliases_zos.h rm -f lib/aliases_extra.h - rm -f lib/canonical.h lib/canonical_sysaix.h lib/canonical_syshpux.h lib/canonical_sysosf1.h lib/canonical_syssolaris.h + rm -f lib/canonical.h lib/canonical_sysaix.h lib/canonical_syshpux.h lib/canonical_sysosf1.h lib/canonical_syssolaris.h lib/canonical_sysos2.h rm -f lib/canonical_aix.h lib/canonical_aix_sysaix.h rm -f lib/canonical_osf1.h lib/canonical_osf1_sysosf1.h rm -f lib/canonical_dos.h + rm -f lib/canonical_os2.h lib/canonical_os2_sysos2.h rm -f lib/canonical_zos.h rm -f lib/canonical_extra.h - rm -f lib/canonical_local.h lib/canonical_local_sysaix.h lib/canonical_local_syshpux.h lib/canonical_local_sysosf1.h lib/canonical_local_syssolaris.h + rm -f lib/canonical_local.h lib/canonical_local_sysaix.h lib/canonical_local_syshpux.h lib/canonical_local_sysosf1.h lib/canonical_local_syssolaris.h lib/canonical_local_sysos2.h rm -f lib/flags.h rm -f lib/translit.h rm -f man/iconv.1.html man/iconv.3.html man/iconv_close.3.html man/iconv_open.3.html man/iconvctl.3.html man/iconv_open_into.3.html
diff --git a/lib/Makefile.in b/lib/Makefile.in index b93856b..e336977 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in
@@ -71,10 +71,11 @@ iconv.lo : $(srcdir)/iconv.c $(srcdir)/converters.h \ $(srcdir)/encodings.def $(srcdir)/encodings_aix.def $(srcdir)/encodings_osf1.def $(srcdir)/encodings_dos.def $(srcdir)/encodings_local.def \ - $(srcdir)/aliases.h $(srcdir)/aliases_sysaix.h $(srcdir)/aliases_syshpux.h $(srcdir)/aliases_sysosf1.h $(srcdir)/aliases_syssolaris.h \ + $(srcdir)/aliases.h $(srcdir)/aliases_sysaix.h $(srcdir)/aliases_syshpux.h $(srcdir)/aliases_sysosf1.h $(srcdir)/aliases_syssolaris.h $(srcdir)/aliases_sysos2.h \ $(srcdir)/aliases_aix.h $(srcdir)/aliases_aix_sysaix.h \ $(srcdir)/aliases_osf1.h $(srcdir)/aliases_osf1_sysosf1.h \ $(srcdir)/aliases_dos.h \ + $(srcdir)/aliases_os2.h $(srcdir)/aliases_os2_sysos2.h \ $(srcdir)/aliases_extra.h \ $(srcdir)/flags.h $(srcdir)/translit.h $(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(DEFS) -c $(srcdir)/iconv.c @@ -396,20 +397,22 @@ IMPORTED_FILES = # List of distributed files generated by autotools or Makefile.devel. GENERATED_FILES = \ - aliases.gperf aliases_sysaix.gperf aliases_syshpux.gperf aliases_sysosf1.gperf aliases_syssolaris.gperf \ - aliases.h aliases_sysaix.h aliases_syshpux.h aliases_sysosf1.h aliases_syssolaris.h \ + aliases.gperf aliases_sysaix.gperf aliases_syshpux.gperf aliases_sysosf1.gperf aliases_syssolaris.gperf aliases_sysos2.gperf \ + aliases.h aliases_sysaix.h aliases_syshpux.h aliases_sysosf1.h aliases_syssolaris.h aliases_sysos2.h \ aliases_aix.h aliases_aix_sysaix.h \ aliases_osf1.h aliases_osf1_sysosf1.h \ aliases_dos.h \ + aliases_os2.h aliases_os2_sysos2.h \ aliases_zos.h \ aliases_extra.h \ - canonical.h canonical_sysaix.h canonical_syshpux.h canonical_sysosf1.h canonical_syssolaris.h \ + canonical.h canonical_sysaix.h canonical_syshpux.h canonical_sysosf1.h canonical_syssolaris.h canonical_sysos2.h \ canonical_aix.h canonical_aix_sysaix.h \ canonical_osf1.h canonical_osf1_sysosf1.h \ canonical_dos.h \ + canonical_os2.h canonical_os2_sysos2.h \ canonical_zos.h \ canonical_extra.h \ - canonical_local.h canonical_local_sysaix.h canonical_local_syshpux.h canonical_local_sysosf1.h canonical_local_syssolaris.h \ + canonical_local.h canonical_local_sysaix.h canonical_local_syshpux.h canonical_local_sysosf1.h canonical_local_syssolaris.h canonical_local_sysos2.h \ flags.h \ translit.h # List of distributed files generated by "make".
diff --git a/lib/aliases2.h b/lib/aliases2.h index 6a65c42..fb9c184 100644 --- a/lib/aliases2.h +++ b/lib/aliases2.h
@@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2003, 2008, 2022 Free Software Foundation, Inc. + * Copyright (C) 1999-2026 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV Library is free software; you can redistribute it @@ -34,6 +34,13 @@ #ifdef USE_DOS # include "aliases_dos.h" #endif +#ifdef USE_OS2 +# if defined __OS2__ +# include "aliases_os2_sysos2.h" +# else +# include "aliases_os2.h" +# endif +#endif #ifdef USE_ZOS # include "aliases_zos.h" #endif
diff --git a/lib/encodings.def b/lib/encodings.def index e5063d3..e77983f 100644 --- a/lib/encodings.def +++ b/lib/encodings.def
@@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2011 Free Software Foundation, Inc. +/* Copyright (C) 1999-2026 Free Software Foundation, Inc. This file is part of the GNU LIBICONV Library. The GNU LIBICONV Library is free software; you can redistribute it @@ -50,6 +50,10 @@ ), ascii, { ascii_mbtowc, NULL }, { ascii_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-367", /* OS/2 */ + ascii) +#endif #ifdef USE_SOLARIS_ALIASES DEFALIAS( "646", /* Solaris */ ascii) @@ -67,6 +71,10 @@ DEFALIAS( "UTF8", /* HP-UX */ utf8) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1208", /* OS/2 */ + utf8) +#endif DEFENCODING(( "UCS-2", /* glibc */ "ISO-10646-UCS-2", /* IANA */ @@ -189,7 +197,7 @@ "LATIN1", /* IANA */ "L1", /* IANA */ "csISOLatin1", /* IANA */ - "ISO8859-1", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris */ + "ISO8859-1", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris, OS/2 */ /*"ISO8859_1", JDK 1.1 */ /*"CP28591", Windows */ ), @@ -199,6 +207,10 @@ DEFALIAS( "ISO88591", /* HP-UX */ iso8859_1) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-819", /* OS/2 */ + iso8859_1) +#endif DEFENCODING(( "ISO-8859-2", /* IANA */ "ISO_8859-2", /* IANA */ @@ -207,7 +219,7 @@ "LATIN2", /* IANA */ "L2", /* IANA */ "csISOLatin2", /* IANA */ - "ISO8859-2", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris */ + "ISO8859-2", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris, OS/2 */ /*"ISO8859_2", JDK 1.1 */ /*"CP28592", Windows */ ), @@ -217,6 +229,10 @@ DEFALIAS( "ISO88592", /* HP-UX */ iso8859_2) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-912", /* OS/2 */ + iso8859_2) +#endif DEFENCODING(( "ISO-8859-3", /* IANA */ "ISO_8859-3", /* IANA */ @@ -225,12 +241,16 @@ "LATIN3", /* IANA */ "L3", /* IANA */ "csISOLatin3", /* IANA */ - "ISO8859-3", /* X11R6.4, glibc, FreeBSD, Solaris */ + "ISO8859-3", /* X11R6.4, glibc, FreeBSD, Solaris, OS/2 */ /*"ISO8859_3", JDK 1.1 */ /*"CP28593", Windows */ ), iso8859_3, { iso8859_3_mbtowc, NULL }, { iso8859_3_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-913", /* OS/2 */ + iso8859_3) +#endif DEFENCODING(( "ISO-8859-4", /* IANA */ "ISO_8859-4", /* IANA */ @@ -239,12 +259,16 @@ "LATIN4", /* IANA */ "L4", /* IANA */ "csISOLatin4", /* IANA */ - "ISO8859-4", /* X11R6.4, glibc, FreeBSD, OSF/1, Solaris */ + "ISO8859-4", /* X11R6.4, glibc, FreeBSD, OSF/1, Solaris, OS/2 */ /*"ISO8859_4", JDK 1.1 */ /*"CP28594", Windows */ ), iso8859_4, { iso8859_4_mbtowc, NULL }, { iso8859_4_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-914", /* OS/2 */ + iso8859_4) +#endif DEFENCODING(( "ISO-8859-5", /* IANA */ "ISO_8859-5", /* IANA */ @@ -252,7 +276,7 @@ "ISO-IR-144", /* IANA */ "CYRILLIC", /* IANA */ "csISOLatinCyrillic", /* IANA */ - "ISO8859-5", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris */ + "ISO8859-5", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris, OS/2 */ /*"ISO8859_5", JDK 1.1 */ /*"CP28595", Windows */ ), @@ -262,6 +286,10 @@ DEFALIAS( "ISO88595", /* HP-UX */ iso8859_5) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-915", /* OS/2 */ + iso8859_5) +#endif DEFENCODING(( "ISO-8859-6", /* IANA */ "ISO_8859-6", /* IANA */ @@ -271,7 +299,7 @@ "ASMO-708", /* IANA */ "ARABIC", /* IANA */ "csISOLatinArabic", /* IANA */ - "ISO8859-6", /* X11R6.4, glibc, FreeBSD, AIX, Solaris */ + "ISO8859-6", /* X11R6.4, glibc, FreeBSD, AIX, Solaris, OS/2 */ /*"ISO8859_6", JDK 1.1 */ /*"CP28596", Windows */ ), @@ -281,6 +309,10 @@ DEFALIAS( "ISO88596", /* HP-UX */ iso8859_6) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1089", /* OS/2 */ + iso8859_6) +#endif DEFENCODING(( "ISO-8859-7", /* IANA, RFC 1947 */ "ISO_8859-7", /* IANA */ @@ -292,7 +324,7 @@ "GREEK8", /* IANA */ "GREEK", /* IANA */ "csISOLatinGreek", /* IANA */ - "ISO8859-7", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris */ + "ISO8859-7", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris, OS/2 */ /*"ISO8859_7", JDK 1.1 */ /*"CP28597", Windows */ ), @@ -302,6 +334,10 @@ DEFALIAS( "ISO88597", /* HP-UX */ iso8859_7) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-813", /* OS/2 */ + iso8859_7) +#endif DEFENCODING(( "ISO-8859-8", /* IANA */ "ISO_8859-8", /* IANA */ @@ -309,7 +345,7 @@ "ISO-IR-138", /* IANA */ "HEBREW", /* IANA */ "csISOLatinHebrew", /* IANA */ - "ISO8859-8", /* X11R6.4, glibc, FreeBSD, AIX, OSF/1, Solaris */ + "ISO8859-8", /* X11R6.4, glibc, FreeBSD, AIX, OSF/1, Solaris, OS/2 */ /*"ISO8859_8", JDK 1.1 */ /*"CP28598", Windows */ /*"CP38598", Windows */ @@ -320,6 +356,10 @@ DEFALIAS( "ISO88598", /* HP-UX */ iso8859_8) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-916", /* OS/2 */ + iso8859_8) +#endif DEFENCODING(( "ISO-8859-9", /* IANA */ "ISO_8859-9", /* IANA */ @@ -328,7 +368,7 @@ "LATIN5", /* IANA */ "L5", /* IANA */ "csISOLatin5", /* IANA */ - "ISO8859-9", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris */ + "ISO8859-9", /* X11R6.4, glibc, FreeBSD, AIX, IRIX, OSF/1, Solaris, OS/2 */ /*"ISO8859_9", JDK 1.1 */ /*"CP28599", Windows */ ), @@ -338,6 +378,10 @@ DEFALIAS( "ISO88599", /* HP-UX */ iso8859_9) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-920", /* OS/2 */ + iso8859_9) +#endif DEFENCODING(( "ISO-8859-10", /* IANA */ "ISO_8859-10", @@ -372,6 +416,10 @@ DEFALIAS( "IBM-921", /* AIX */ iso8859_13) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-921", /* OS/2 */ + iso8859_13) +#endif DEFENCODING(( "ISO-8859-14", /* IANA, glibc */ "ISO_8859-14", /* IANA */ @@ -399,6 +447,10 @@ DEFALIAS( "ISO885915", /* HP-UX */ iso8859_15) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-923", /* OS/2 */ + iso8859_15) +#endif DEFENCODING(( "ISO-8859-16", /* IANA */ "ISO_8859-16", /* IANA */ @@ -417,6 +469,10 @@ ), koi8_r, { koi8_r_mbtowc, NULL }, { koi8_r_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-878", /* OS/2 */ + koi8_r) +#endif DEFENCODING(( "KOI8-U", /* IANA, RFC 2319 */ ), @@ -437,6 +493,10 @@ ), cp1250, { cp1250_mbtowc, NULL }, { cp1250_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1250", /* OS/2 */ + cp1250) +#endif DEFENCODING(( "CP1251", /* JDK 1.1 */ "WINDOWS-1251", /* IANA */ @@ -444,6 +504,10 @@ ), cp1251, { cp1251_mbtowc, NULL }, { cp1251_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1251", /* OS/2 */ + cp1251) +#endif #ifdef USE_SOLARIS_ALIASES DEFALIAS( "ANSI-1251", /* Solaris */ cp1251) @@ -455,8 +519,12 @@ ), cp1252, { cp1252_mbtowc, NULL }, { cp1252_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-1252", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-1252", /* AIX, OS/2 */ + cp1252) +#endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1004", /* OS/2 */ cp1252) #endif @@ -466,6 +534,10 @@ ), cp1253, { cp1253_mbtowc, NULL }, { cp1253_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1253", /* OS/2 */ + cp1253) +#endif DEFENCODING(( "CP1254", /* JDK 1.1 */ "WINDOWS-1254", /* IANA */ @@ -473,6 +545,10 @@ ), cp1254, { cp1254_mbtowc, NULL }, { cp1254_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1254", /* OS/2 */ + cp1254) +#endif DEFENCODING(( "CP1255", /* JDK 1.1 */ "WINDOWS-1255", /* IANA */ @@ -480,6 +556,10 @@ ), cp1255, { cp1255_mbtowc, cp1255_flushwc }, { cp1255_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1255", /* OS/2 */ + cp1255) +#endif DEFENCODING(( "CP1256", /* JDK 1.1 */ "WINDOWS-1256", /* IANA */ @@ -487,6 +567,10 @@ ), cp1256, { cp1256_mbtowc, NULL }, { cp1256_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1256", /* OS/2 */ + cp1256) +#endif DEFENCODING(( "CP1257", /* JDK 1.1 */ "WINDOWS-1257", /* IANA */ @@ -494,6 +578,10 @@ ), cp1257, { cp1257_mbtowc, NULL }, { cp1257_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1257", /* OS/2 */ + cp1257) +#endif DEFENCODING(( "CP1258", /* JDK 1.1 */ "WINDOWS-1258", /* IANA */ @@ -510,8 +598,12 @@ ), cp850, { cp850_mbtowc, NULL }, { cp850_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-850", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-850", /* AIX, OS/2 */ + cp850) +#endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-4946", /* OS/2 */ cp850) #endif @@ -522,6 +614,10 @@ ), cp862, { cp862_mbtowc, NULL }, { cp862_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-862", /* OS/2 */ + cp862) +#endif DEFENCODING(( "CP866", /* IANA, JDK 1.1 */ "IBM866", /* IANA */ @@ -530,13 +626,17 @@ ), cp866, { cp866_mbtowc, NULL }, { cp866_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-866", /* OS/2 */ + cp866) +#endif DEFENCODING(( "CP1131", /* FreeBSD, MacOS X */ ), cp1131, { cp1131_mbtowc, NULL }, { cp1131_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-1131", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-1131", /* AIX, OS/2 */ cp1131) #endif @@ -708,6 +808,10 @@ ), cp874, { cp874_mbtowc, NULL }, { cp874_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-874", /* OS/2 */ + cp874) +#endif DEFENCODING(( "VISCII", /* IANA, RFC 1456 */ "VISCII1.1-1", @@ -811,7 +915,7 @@ /* CJK encodings */ DEFENCODING(( "EUC-JP", /* IANA */ - "EUCJP", /* glibc, HP-UX, IRIX, OSF/1, Solaris */ + "EUCJP", /* glibc, HP-UX, IRIX, OSF/1, Solaris, OS/2 */ "Extended_UNIX_Code_Packed_Format_for_Japanese", /* IANA */ "csEUCPkdFmtJapanese", /* IANA */ /*"EUC_JP", JDK 1.1 */ @@ -819,10 +923,19 @@ ), euc_jp, { euc_jp_mbtowc, NULL }, { euc_jp_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-EUCJP", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-EUCJP", /* AIX, OS/2 */ euc_jp) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-3372", /* OS/2 */ + euc_jp) +DEFALIAS( "IBM-33722", /* OS/2 */ + euc_jp) +DEFALIAS( "IBM-954", /* OS/2 */ + euc_jp) +#endif + #ifdef USE_OSF1_ALIASES DEFALIAS( "SDECKANJI", /* OSF/1 */ euc_jp) @@ -845,8 +958,8 @@ ), cp932, { cp932_mbtowc, NULL }, { cp932_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-932", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-932", /* AIX, OS/2 */ cp932) #endif @@ -885,14 +998,20 @@ ), euc_cn, { euc_cn_mbtowc, NULL }, { euc_cn_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-EUCCN", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-EUCCN", /* AIX, OS/2 */ euc_cn) #endif #ifdef USE_HPUX_ALIASES DEFALIAS( "HP15CN", /* HP-UX */ euc_cn) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1381", /* OS/2 */ + euc_cn) +DEFALIAS( "IBM-1383", /* OS/2 */ + euc_cn) +#endif #ifdef USE_OSF1_ALIASES DEFALIAS( "DECHANZI", /* OSF/1 */ euc_cn) @@ -902,6 +1021,10 @@ ), ces_gbk, { ces_gbk_mbtowc, NULL }, { ces_gbk_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1386", /* OS/2 */ + ces_gbk) +#endif DEFENCODING(( "CP936", /* IANA */ "MS936", /* IANA */ @@ -949,8 +1072,14 @@ ), euc_tw, { euc_tw_mbtowc, NULL }, { euc_tw_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-EUCTW", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-EUCTW", /* AIX, OS/2 */ + euc_tw) +#endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "EUCTW-1993", /* OS/2 */ + euc_tw) +DEFALIAS( "IBM-964", /* OS/2 */ euc_tw) #endif #ifdef USE_SOLARIS_ALIASES @@ -972,6 +1101,10 @@ ), cp950, { cp950_mbtowc, NULL }, { cp950_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-950", /* OS/2 */ + cp950) +#endif DEFENCODING(( "BIG5-HKSCS:1999", ), @@ -996,21 +1129,25 @@ { big5hkscs2008_mbtowc, big5hkscs2008_flushwc }, { big5hkscs2008_wctomb, big5hkscs2008_reset }) DEFENCODING(( "EUC-KR", /* IANA, RFC 1557 */ - "EUCKR", /* glibc, HP-UX, IRIX, OSF/1 */ + "EUCKR", /* glibc, HP-UX, IRIX, OSF/1, OS/2 */ "csEUCKR", /* IANA */ /*"EUC_KR", JDK 1.1 */ /*"CP51949", Windows */ ), euc_kr, { euc_kr_mbtowc, NULL }, { euc_kr_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-EUCKR", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-EUCKR", /* AIX, OS/2 */ euc_kr) #endif #ifdef USE_OSF1_ALIASES DEFALIAS( "DECKOREAN", /* OSF/1 */ euc_kr) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-970", /* OS/2 */ + euc_kr) +#endif #ifdef USE_SOLARIS_ALIASES DEFALIAS( "5601", /* Solaris */ euc_kr) @@ -1025,6 +1162,10 @@ DEFALIAS( "KSC5601", /* OSF/1 */ cp949) #endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-949", /* OS/2 */ + cp949) +#endif DEFENCODING(( "JOHAB", /* glibc */ "CP1361", /* glibc */
diff --git a/lib/encodings_aix.def b/lib/encodings_aix.def index 0a065f7..277befd 100644 --- a/lib/encodings_aix.def +++ b/lib/encodings_aix.def
@@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2002, 2008 Free Software Foundation, Inc. +/* Copyright (C) 2000-2026 Free Software Foundation, Inc. This file is part of the GNU LIBICONV Library. The GNU LIBICONV Library is free software; you can redistribute it @@ -21,8 +21,8 @@ ), cp856, { cp856_mbtowc, NULL }, { cp856_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-856", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-856", /* AIX, OS/2 */ cp856) #endif @@ -30,8 +30,8 @@ ), cp922, { cp922_mbtowc, NULL }, { cp922_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-922", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-922", /* AIX, OS/2 */ cp922) #endif @@ -39,8 +39,14 @@ ), cp943, { cp943_mbtowc, NULL }, { cp943_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-943", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-943", /* AIX, OS/2 */ + cp943) +#endif +#ifdef USE_OS2_ALIASES +DEFALIAS( "SJIS-1", /* OS/2 */ + cp943) +DEFALIAS( "SJIS-2", /* OS/2 */ cp943) #endif @@ -57,8 +63,8 @@ ), cp1124, { cp1124_mbtowc, NULL }, { cp1124_wctomb, NULL }) -#ifdef USE_AIX_ALIASES -DEFALIAS( "IBM-1124", /* AIX */ +#if defined USE_AIX_ALIASES || defined USE_OS2_ALIASES +DEFALIAS( "IBM-1124", /* AIX, OS/2 */ cp1124) #endif
diff --git a/lib/encodings_dos.def b/lib/encodings_dos.def index ae8cc55..6d777c9 100644 --- a/lib/encodings_dos.def +++ b/lib/encodings_dos.def
@@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002 Free Software Foundation, Inc. +/* Copyright (C) 2001-2026 Free Software Foundation, Inc. This file is part of the GNU LIBICONV Library. The GNU LIBICONV Library is free software; you can redistribute it @@ -24,6 +24,10 @@ ), cp437, { cp437_mbtowc, NULL }, { cp437_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-437", /* OS/2 */ + cp437) +#endif DEFENCODING(( "CP737", /* JDK 1.1 */ ), @@ -44,6 +48,10 @@ ), cp852, { cp852_mbtowc, NULL }, { cp852_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-852", /* OS/2 */ + cp852) +#endif DEFENCODING(( "CP853", ), @@ -57,6 +65,10 @@ ), cp855, { cp855_mbtowc, NULL }, { cp855_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-855", /* OS/2 */ + cp855) +#endif DEFENCODING(( "CP857", /* IANA, JDK 1.1 */ "IBM857", /* IANA */ @@ -65,6 +77,10 @@ ), cp857, { cp857_mbtowc, NULL }, { cp857_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-857", /* OS/2 */ + cp857) +#endif DEFENCODING(( "CP858", /* JDK 1.1.7 */ ), @@ -78,6 +94,10 @@ ), cp860, { cp860_mbtowc, NULL }, { cp860_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-860", /* OS/2 */ + cp860) +#endif DEFENCODING(( "CP861", /* IANA, JDK 1.1 */ "IBM861", /* IANA */ @@ -87,6 +107,10 @@ ), cp861, { cp861_mbtowc, NULL }, { cp861_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-861", /* OS/2 */ + cp861) +#endif DEFENCODING(( "CP863", /* IANA, JDK 1.1 */ "IBM863", /* IANA */ @@ -95,6 +119,10 @@ ), cp863, { cp863_mbtowc, NULL }, { cp863_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-863", /* OS/2 */ + cp863) +#endif DEFENCODING(( "CP864", /* IANA, JDK 1.1 */ "IBM864", /* IANA */ @@ -102,6 +130,10 @@ ), cp864, { cp864_mbtowc, NULL }, { cp864_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-864", /* OS/2 */ + cp864) +#endif DEFENCODING(( "CP865", /* IANA, JDK 1.1 */ "IBM865", /* IANA */ @@ -110,6 +142,10 @@ ), cp865, { cp865_mbtowc, NULL }, { cp865_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-865", /* OS/2 */ + cp865) +#endif DEFENCODING(( "CP869", /* IANA, JDK 1.1 */ "IBM869", /* IANA */ @@ -119,8 +155,16 @@ ), cp869, { cp869_mbtowc, NULL }, { cp869_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-869", /* OS/2 */ + cp869) +#endif DEFENCODING(( "CP1125", /* ICU */ ), cp1125, { cp1125_mbtowc, NULL }, { cp1125_wctomb, NULL }) +#ifdef USE_OS2_ALIASES +DEFALIAS( "IBM-1125", /* OS/2 */ + cp1125) +#endif
diff --git a/lib/genaliases2.c b/lib/genaliases2.c index 51a951c..4b7942e 100644 --- a/lib/genaliases2.c +++ b/lib/genaliases2.c
@@ -1,4 +1,4 @@ -/* Copyright (C) 1999-2003, 2005, 2008, 2012, 2022 Free Software Foundation, Inc. +/* Copyright (C) 1999-2026 Free Software Foundation, Inc. This file is part of the GNU LIBICONV Library. The GNU LIBICONV Library is free software; you can redistribute it @@ -93,6 +93,10 @@ #ifdef USE_DOS #include "encodings_dos.def" #endif +#ifdef USE_OS2 +#include "encodings_aix.def" +#include "encodings_dos.def" +#endif #ifdef USE_ZOS #include "encodings_zos.def" #endif
diff --git a/lib/genflags.c b/lib/genflags.c index 9f3d15d..b15c1f7 100644 --- a/lib/genflags.c +++ b/lib/genflags.c
@@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2002, 2005-2006, 2008-2009, 2016, 2022-2023 Free Software Foundation, Inc. +/* Copyright (C) 2000-2026 Free Software Foundation, Inc. This file is part of the GNU LIBICONV Library. The GNU LIBICONV Library is free software; you can redistribute it @@ -31,6 +31,7 @@ #define USE_AIX #define USE_OSF1 #define USE_DOS +#define USE_OS2 #define USE_ZOS #define USE_EXTRA
diff --git a/lib/iconv.c b/lib/iconv.c index 1324897..ec704cf 100644 --- a/lib/iconv.c +++ b/lib/iconv.c
@@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2024 Free Software Foundation, Inc. + * Copyright (C) 1999-2026 Free Software Foundation, Inc. * This file is part of the GNU LIBICONV Library. * * The GNU LIBICONV Library is free software; you can redistribute it @@ -37,6 +37,7 @@ #define USE_AIX #define USE_OSF1 #define USE_DOS +#define USE_OS2 #define USE_ZOS #define USE_EXTRA #else @@ -44,15 +45,18 @@ * Consider those system dependent encodings that are needed for the * current system. */ -#ifdef _AIX +#if defined(_AIX) || defined(__OS2__) #define USE_AIX #endif #if defined(__osf__) || defined(VMS) #define USE_OSF1 #endif -#if defined(__DJGPP__) || (defined(_WIN32) && (defined(_MSC_VER) || defined(__MINGW32__))) +#if defined(__DJGPP__) || (defined(_WIN32) && (defined(_MSC_VER) || defined(__MINGW32__))) || defined(__OS2__) #define USE_DOS #endif +#ifdef __OS2__ +#define USE_OS2 +#endif /* Enable the EBCDIC encodings not only on z/OS but also on Linux/s390, for easier interoperability between z/OS and Linux/s390. */ #if defined(__MVS__) || (defined(__linux__) && (defined(__s390__) || defined(__s390x__))) @@ -162,6 +166,8 @@ # include "aliases_sysosf1.h" #elif defined __sun # include "aliases_syssolaris.h" +#elif defined __OS2__ +# include "aliases_sysos2.h" #else # include "aliases.h" #endif @@ -171,7 +177,7 @@ * Defines * const struct alias * aliases2_lookup (const char *str); */ -#if defined(USE_AIX) || defined(USE_OSF1) || defined(USE_DOS) || defined(USE_ZOS) || defined(USE_EXTRA) /* || ... */ +#if defined(USE_AIX) || defined(USE_OSF1) || defined(USE_DOS) || defined(USE_OS2) || defined(USE_ZOS) || defined(USE_EXTRA) /* || ... */ struct stringpool2_t { #define S(tag,name,encoding_index) char stringpool_##tag[sizeof(name)]; #include "aliases2.h" @@ -514,6 +520,8 @@ # include "canonical_sysosf1.h" #elif defined __sun # include "canonical_syssolaris.h" +#elif defined __OS2__ +# include "canonical_sysos2.h" #else # include "canonical.h" #endif @@ -534,6 +542,13 @@ #ifdef USE_DOS # include "canonical_dos.h" #endif +#ifdef USE_OS2 +# if defined __OS2__ +# include "canonical_os2_sysos2.h" +# else +# include "canonical_os2.h" +# endif +#endif #ifdef USE_ZOS # include "canonical_zos.h" #endif @@ -548,6 +563,8 @@ # include "canonical_local_sysosf1.h" #elif defined __sun # include "canonical_local_syssolaris.h" +#elif defined __OS2__ +# include "canonical_local_sysos2.h" #else # include "canonical_local.h" #endif