]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
intl: Merge from glibc.
authorBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2023 18:44:18 +0000 (20:44 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2023 22:36:55 +0000 (00:36 +0200)
Apply commit
2020-09-25  Arjun Shankar  <arjun@redhat.com>
intl: Handle translation output codesets with suffixes [BZ #26383]

gettext-runtime/intl/dcigettext.c

index 265ef3ba7556db286db075ca9e290f6903a5b63a..0ed40d6f53db6ce0d556319ec1bda1d60cba9021 100644 (file)
@@ -1189,15 +1189,18 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
 
 # ifdef _LIBC
 
-                     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
-                         };
+                     struct gconv_spec conv_spec;
+
+                      __gconv_create_spec (&conv_spec, charset, outcharset);
+
+                     /* We always want to use transliteration.  */
+                      conv_spec.translit = true;
+
                      int r = __gconv_open (&conv_spec, &convd->conv,
                                            GCONV_AVOID_NOCONV);
+
+                      __gconv_destroy_spec (&conv_spec);
+
                      if (__builtin_expect (r != __GCONV_OK, 0))
                        {
                          /* If the output encoding is the same there is