From f5c9a0848694dbb74721404cf1878a9369acb13f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 14 Jun 2023 09:37:18 +0200 Subject: [PATCH] Trivial refactoring. * 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 | 5 ++--- gettext-tools/src/msgmerge.c | 4 ++-- gettext-tools/src/xgettext.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gettext-tools/src/msgcmp.c b/gettext-tools/src/msgcmp.c index 8e5f6bec9..74a91f97a 100644 --- a/gettext-tools/src/msgcmp.c +++ b/gettext-tools/src/msgcmp.c @@ -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 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 diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c index d165a3854..d9f00c1be 100644 --- a/gettext-tools/src/msgmerge.c +++ b/gettext-tools/src/msgmerge.c @@ -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], diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c index 1c8649fb1..b2fc45d06 100644 --- a/gettext-tools/src/xgettext.c +++ b/gettext-tools/src/xgettext.c @@ -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); } -- 2.47.2