]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Trivial refactoring.
authorBruno Haible <bruno@clisp.org>
Wed, 14 Jun 2023 07:37:18 +0000 (09:37 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 15 Jun 2023 09:26:58 +0000 (11:26 +0200)
* gettext-tools/src/msgcmp.c (compare): Pass po_charset_utf8 to
iconv_msgdomain_list.
* gettext-tools/src/msgmerge.c (merge): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.

gettext-tools/src/msgcmp.c
gettext-tools/src/msgmerge.c
gettext-tools/src/xgettext.c

index 8e5f6bec9cdb40ec222eadaedc1f0423e59e71b2..74a91f97a6e5cba914b0478d67809a91a0c38fc1 100644 (file)
@@ -1,6 +1,5 @@
 /* GNU gettext - internationalization aids
-   Copyright (C) 1995-1998, 2000-2010, 2012, 2016, 2018-2022 Free Software
-   Foundation, Inc.
+   Copyright (C) 1995-1998, 2000-2010, 2012, 2016, 2018-2023 Free Software Foundation, Inc.
    This file was written by Peter Miller <millerp@canb.auug.org.au>
 
    This program is free software: you can redistribute it and/or modify
@@ -432,7 +431,7 @@ compare (const char *fn1, const char *fn2, catalog_input_format_ty input_syntax)
             }
         }
     if (was_utf8)
-      def = iconv_msgdomain_list (def, "UTF-8", true, fn1);
+      def = iconv_msgdomain_list (def, po_charset_utf8, true, fn1);
   }
 
   /* Determine canonicalized encoding name of the definitions now, after
index d165a3854fe23663499dfffd7f11f2263bbe3881..d9f00c1be28b4aa1f6dc0d8de10427368ac4dff3 100644 (file)
@@ -1820,7 +1820,7 @@ merge (const char *fn1, const char *fn2, catalog_input_format_ty input_syntax,
         }
     if (was_utf8)
       {
-        def = iconv_msgdomain_list (def, "UTF-8", true, fn1);
+        def = iconv_msgdomain_list (def, po_charset_utf8, true, fn1);
         if (compendiums != NULL)
           for (k = 0; k < compendiums->nitems; k++)
             iconv_message_list (compendiums->item[k], NULL, po_charset_utf8,
@@ -1964,7 +1964,7 @@ merge (const char *fn1, const char *fn2, catalog_input_format_ty input_syntax,
               {
                 /* It's too hairy to find out what would be the optimal target
                    encoding.  So, convert everything to UTF-8.  */
-                def = iconv_msgdomain_list (def, "UTF-8", true, fn1);
+                def = iconv_msgdomain_list (def, po_charset_utf8, true, fn1);
                 if (compendiums != NULL)
                   for (k = 0; k < compendiums->nitems; k++)
                     iconv_message_list (compendiums->item[k],
index 1c8649fb1557563e65d60686cc33be624e8a8295..b2fc45d066bae39ea38de1324d8ce059d6403c5b 100644 (file)
@@ -848,7 +848,7 @@ xgettext cannot work without keywords to look for"));
 
       extract_from_file (file_name, po_extractor, mdlp);
       if (!is_ascii_msgdomain_list (mdlp))
-        mdlp = iconv_msgdomain_list (mdlp, "UTF-8", true, file_name);
+        mdlp = iconv_msgdomain_list (mdlp, po_charset_utf8, true, file_name);
 
       dir_list_restore (saved_directory_list);
     }