]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - intl/dcigettext.c
Rewrite iconv option parsing [BZ #19519]
[thirdparty/glibc.git] / intl / dcigettext.c
index 465c8df34ccfd8b698249af65999d7865f912143..2e7c662bc7865bfaa8f9d20f5408da044aef8129 100644 (file)
@@ -1119,11 +1119,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