]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Drop workarounds for glibc 2.1 and Solaris 9.
authorBruno Haible <bruno@clisp.org>
Mon, 9 Sep 2024 14:10:31 +0000 (16:10 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 10 Sep 2024 01:59:08 +0000 (03:59 +0200)
* gettext-tools/src/read-po-lex.c (po_lex_charset_set): Remove glibc 2.1 and
Solaris 9 workarounds.
* gettext-tools/src/recode-sr-latin.c (process): Likewise.
* gettext-tools/src/write-po.c (wrap): Likewise.
* gettext-tools/src/x-python.c (set_current_file_source_encoding): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* libtextstyle/gnulib-local/lib/iconv-ostream.oo.c (iconv_ostream::free,
iconv_ostream_create): Likewise.

gettext-tools/src/read-po-lex.c
gettext-tools/src/recode-sr-latin.c
gettext-tools/src/write-po.c
gettext-tools/src/x-python.c
gettext-tools/src/xgettext.c
libtextstyle/gnulib-local/lib/iconv-ostream.oo.c

index 5ca52f00d8130b48f53fdf612293b54fb6eddcc0..b1ed37923d291b714f960a3a221295babfa1a365 100644 (file)
@@ -227,25 +227,6 @@ Message conversion to user's charset might not work.\n"),
             {
               /* Use iconv() to parse multibyte characters.  */
 #if HAVE_ICONV
-              /* Avoid glibc-2.1 bug with EUC-KR.  */
-# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
-     && !defined _LIBICONV_VERSION
-              if (strcmp (ps->po_lex_charset, "EUC-KR") == 0)
-                ps->po_lex_iconv = (iconv_t)(-1);
-              else
-# endif
-              /* Avoid Solaris 2.9 bug with GB2312, EUC-TW, BIG5, BIG5-HKSCS,
-                 GBK, GB18030.  */
-# if defined __sun && !defined _LIBICONV_VERSION
-              if (   strcmp (ps->po_lex_charset, "GB2312") == 0
-                  || strcmp (ps->po_lex_charset, "EUC-TW") == 0
-                  || strcmp (ps->po_lex_charset, "BIG5") == 0
-                  || strcmp (ps->po_lex_charset, "BIG5-HKSCS") == 0
-                  || strcmp (ps->po_lex_charset, "GBK") == 0
-                  || strcmp (ps->po_lex_charset, "GB18030") == 0)
-                ps->po_lex_iconv = (iconv_t)(-1);
-              else
-# endif
               ps->po_lex_iconv = iconv_open ("UTF-8", ps->po_lex_charset);
               if (ps->po_lex_iconv == (iconv_t)(-1))
                 {
index d5989319f3d0a37884accad442d02e40b3515364..6a9971ffafa62c08ffba68bf88fde5d89c77dd14 100644 (file)
@@ -275,16 +275,9 @@ process (FILE *stream)
   if (need_code_conversion)
     {
 #if HAVE_ICONV
-      /* Avoid glibc-2.1 bug with EUC-KR.  */
-# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
-     && !defined _LIBICONV_VERSION
-      if (strcmp (locale_code, "EUC-KR") != 0)
-# endif
-        {
-          conv_to_utf8 = iconv_open ("UTF-8", locale_code);
-          /* TODO:  Maybe append //TRANSLIT here?  */
-          conv_from_utf8 = iconv_open (locale_code, "UTF-8");
-        }
+      conv_to_utf8 = iconv_open ("UTF-8", locale_code);
+      /* TODO:  Maybe append //TRANSLIT here?  */
+      conv_from_utf8 = iconv_open (locale_code, "UTF-8");
       if (conv_to_utf8 == (iconv_t)(-1))
         error (EXIT_FAILURE, 0,
                _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(), and iconv() does not support this conversion."),
index eeb190a0ed0b7b908f797fb5343b8c5849629055..c50fff73e92f765731c09112a11aa2f11a16d28e 100644 (file)
@@ -685,25 +685,6 @@ wrap (const message_ty *mp, ostream_t stream,
       /* Invalid PO file encoding.  */
       conv = (iconv_t)(-1);
     else
-      /* Avoid glibc-2.1 bug with EUC-KR.  */
-# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
-     && !defined _LIBICONV_VERSION
-      if (strcmp (canon_charset, "EUC-KR") == 0)
-        conv = (iconv_t)(-1);
-      else
-# endif
-      /* Avoid Solaris 2.9 bug with GB2312, EUC-TW, BIG5, BIG5-HKSCS, GBK,
-         GB18030.  */
-# if defined __sun && !defined _LIBICONV_VERSION
-      if (   strcmp (canon_charset, "GB2312") == 0
-          || strcmp (canon_charset, "EUC-TW") == 0
-          || strcmp (canon_charset, "BIG5") == 0
-          || strcmp (canon_charset, "BIG5-HKSCS") == 0
-          || strcmp (canon_charset, "GBK") == 0
-          || strcmp (canon_charset, "GB18030") == 0)
-        conv = (iconv_t)(-1);
-      else
-# endif
       /* Use iconv() to parse multibyte characters.  */
       conv = iconv_open ("UTF-8", canon_charset);
 
index 42bfd9d2d7a9c0e38e36ebed76723e14a84ea0d5..0c85c3799f0b49da7387d4c3680296bade5f02a8 100644 (file)
@@ -618,16 +618,9 @@ set_current_file_source_encoding (const char *canon_encoding)
       && xgettext_current_file_source_encoding != po_charset_utf8)
     {
 #if HAVE_ICONV
-      iconv_t cd;
+      iconv_t cd =
+        iconv_open (po_charset_utf8, xgettext_current_file_source_encoding);
 
-      /* Avoid glibc-2.1 bug with EUC-KR.  */
-# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
-     && !defined _LIBICONV_VERSION
-      if (strcmp (xgettext_current_file_source_encoding, "EUC-KR") == 0)
-        cd = (iconv_t)(-1);
-      else
-# endif
-      cd = iconv_open (po_charset_utf8, xgettext_current_file_source_encoding);
       if (cd == (iconv_t)(-1))
         error_at_line (EXIT_FAILURE, 0, logical_file_name, line_number - 1,
                        _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(), and iconv() does not support this conversion."),
index a9c2f04dd1c27416711b710dd0239f0605b8de15..928a3d75230ba5d4351b5892501644cabc78d58f 100644 (file)
@@ -808,16 +808,9 @@ xgettext cannot work without keywords to look for"));
       && xgettext_global_source_encoding != po_charset_utf8)
     {
 #if HAVE_ICONV
-      iconv_t cd;
+      iconv_t cd =
+        iconv_open (po_charset_utf8, xgettext_global_source_encoding);
 
-      /* Avoid glibc-2.1 bug with EUC-KR.  */
-# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
-     && !defined _LIBICONV_VERSION
-      if (strcmp (xgettext_global_source_encoding, "EUC-KR") == 0)
-        cd = (iconv_t)(-1);
-      else
-# endif
-      cd = iconv_open (po_charset_utf8, xgettext_global_source_encoding);
       if (cd == (iconv_t)(-1))
         error (EXIT_FAILURE, 0,
                _("Cannot convert from \"%s\" to \"%s\". %s relies on iconv(), and iconv() does not support this conversion."),
index 9c6e02a9fa3aa0826a2252d557b8abb53ac1c315..60cb17437f4258dddc2c4d4110af7d80c2b33b46 100644 (file)
@@ -155,11 +155,6 @@ iconv_ostream::free (iconv_ostream_t stream)
   /* Silently ignore the few bytes in stream->buf[] that don't correspond to a
      character.  */
 
-  /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
-  #if defined _LIBICONV_VERSION \
-      || !(((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) \
-            && !defined __UCLIBC__) \
-           || defined __sun)
   {
     char outbuffer[2048];
     char *outptr = outbuffer;
@@ -173,7 +168,6 @@ iconv_ostream::free (iconv_ostream_t stream)
       ostream_write_mem (stream->destination,
                          outbuffer, sizeof (outbuffer) - outsize);
   }
-  #endif
 
   iconv_close (stream->cd);
   free (stream->from_encoding);
@@ -194,16 +188,7 @@ iconv_ostream_create (const char *from_encoding, const char *to_encoding,
   stream->from_encoding = xstrdup (from_encoding);
   stream->to_encoding = xstrdup (to_encoding);
 
-  /* Avoid glibc-2.1 bug with EUC-KR.  */
-  #if ((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) \
-       && !defined __UCLIBC__) \
-      && !defined _LIBICONV_VERSION
-  if (c_strcasecmp (from_encoding, "EUC-KR") == 0
-      || c_strcasecmp (to_encoding, "EUC-KR") == 0)
-    stream->cd = (iconv_t)(-1):
-  else
-  #endif
-    stream->cd = iconv_open (to_encoding, from_encoding);
+  stream->cd = iconv_open (to_encoding, from_encoding);
   if (stream->cd == (iconv_t)(-1))
     {
       if (iconv_open ("UTF-8", from_encoding) == (iconv_t)(-1))