]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
intl: Merge from glibc.
authorBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2023 18:41:37 +0000 (20:41 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2023 22:36:55 +0000 (00:36 +0200)
Apply commit
2020-07-07  Arjun Shankar  <arjun@redhat.com>
Rewrite iconv option parsing [BZ #19519]

gettext-runtime/intl/dcigettext.c

index 8e7db219f660db1fe2a5e174157042f43d0d4d40..265ef3ba7556db286db075ca9e290f6903a5b63a 100644 (file)
@@ -1188,11 +1188,16 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
                      outcharset = encoding;
 
 # ifdef _LIBC
-                     /* We always want to use transliteration.  */
-                     outcharset = norm_add_slashes (outcharset, "TRANSLIT");
-                     charset = norm_add_slashes (charset, "");
-                     int r = __gconv_open (outcharset, charset, &convd->conv,
-                                           GCONV_AVOID_NOCONV);
+
+                     struct gconv_spec conv_spec
+                       = { .fromcode = norm_add_slashes (charset, ""),
+                           .tocode = norm_add_slashes (outcharset, ""),
+                           /* We always want to use transliteration.  */
+                           .translit = true,
+                           .ignore = false
+                         };
+                     int r = __gconv_open (&conv_spec, &convd->conv,
+                                           GCONV_AVOID_NOCONV);
                      if (__builtin_expect (r != __GCONV_OK, 0))
                        {
                          /* If the output encoding is the same there is