94084c
commit 7e0ad15c0fbfe25435c1acd0ed3e9cedfbff2488
94084c
Author: Carlos O'Donell <carlos@redhat.com>
94084c
Date:   Mon Jan 31 00:34:42 2022 -0500
94084c
94084c
    localedata: Adjust C.UTF-8 to align with C/POSIX.
94084c
    
94084c
    We have had one downstream report from Canonical [1] that
94084c
    an rrdtool test was broken by the differences in LC_TIME
94084c
    that we had in the non-builtin C locale (C.UTF-8). If one
94084c
    application has an issue there are going to be others, and
94084c
    so with this commit we review and fix all the issues that
94084c
    cause the builtin C locale to be different from C.UTF-8,
94084c
    which includes:
94084c
    * mon_decimal_point should be empty e.g. ""
94084c
     - Depends on mon_decimal_point_wc fix.
94084c
    * negative_sign should be empty e.g. ""
94084c
    * week should be aligned with the builtin C/POSIX locale
94084c
    * d_fmt corrected with escaped slashes e.g. "%m//%d//%y"
94084c
    * yesstr and nostr should be empty e.g. ""
94084c
    * country_ab2 and country_ab3 should be empty e.g. ""
94084c
    
94084c
    We bump LC_IDENTIFICATION version and adjust the date to
94084c
    indicate the change in the locale.
94084c
    
94084c
    A new tst-c-utf8-consistency test is added to ensure
94084c
    consistency between C/POSIX and C.UTF-8.
94084c
    
94084c
    Tested on x86_64 and i686 without regression.
94084c
    
94084c
    [1] https://sourceware.org/pipermail/libc-alpha/2022-January/135703.html
94084c
    
94084c
    Co-authored-by: Florian Weimer <fweimer@redhat.com>
94084c
    Reviewed-by: Florian Weimer <fweimer@redhat.com>
94084c
94084c
diff --git a/localedata/Makefile b/localedata/Makefile
94084c
index c9dd5a954e8194cc..5830b9d05141cccd 100644
94084c
--- a/localedata/Makefile
94084c
+++ b/localedata/Makefile
94084c
@@ -155,11 +155,31 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl            \
94084c
 		     tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans      \
94084c
 		     tst_wctype tst_wcwidth
94084c
 
94084c
-tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
94084c
-	tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
94084c
-	tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
94084c
-	tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 \
94084c
-	tst-wctype tst-iconv-math-trans
94084c
+tests = \
94084c
+  $(locale_test_suite) \
94084c
+  bug-iconv-trans \
94084c
+  bug-setlocale1 \
94084c
+  bug-usesetlocale \
94084c
+  tst-c-utf8-consistency \
94084c
+  tst-digits \
94084c
+  tst-iconv-math-trans \
94084c
+  tst-leaks \
94084c
+  tst-mbswcs1 \
94084c
+  tst-mbswcs2 \
94084c
+  tst-mbswcs3 \
94084c
+  tst-mbswcs4 \
94084c
+  tst-mbswcs5 \
94084c
+  tst-mbswcs6 \
94084c
+  tst-setlocale \
94084c
+  tst-setlocale2 \
94084c
+  tst-setlocale3 \
94084c
+  tst-sscanf \
94084c
+  tst-strfmon1 \
94084c
+  tst-wctype \
94084c
+  tst-xlocale1 \
94084c
+  tst-xlocale2 \
94084c
+  # tests
94084c
+
94084c
 tests-static = bug-setlocale1-static
94084c
 tests += $(tests-static)
94084c
 ifeq (yes,$(build-shared))
94084c
diff --git a/localedata/locales/C b/localedata/locales/C
94084c
index ca801c79cf7e953e..fc0614e551519c6b 100644
94084c
--- a/localedata/locales/C
94084c
+++ b/localedata/locales/C
94084c
@@ -12,8 +12,8 @@ tel        ""
94084c
 fax        ""
94084c
 language   ""
94084c
 territory  ""
94084c
-revision   "2.0"
94084c
-date       "2020-06-28"
94084c
+revision   "2.1"
94084c
+date       "2022-01-30"
94084c
 category  "i18n:2012";LC_IDENTIFICATION
94084c
 category  "i18n:2012";LC_CTYPE
94084c
 category  "i18n:2012";LC_COLLATE
94084c
@@ -68,11 +68,11 @@ LC_MONETARY
94084c
 % glibc/locale/C-monetary.c.).
94084c
 int_curr_symbol     ""
94084c
 currency_symbol     ""
94084c
-mon_decimal_point   "."
94084c
+mon_decimal_point   ""
94084c
 mon_thousands_sep   ""
94084c
 mon_grouping        -1
94084c
 positive_sign       ""
94084c
-negative_sign       "-"
94084c
+negative_sign       ""
94084c
 int_frac_digits     -1
94084c
 frac_digits         -1
94084c
 p_cs_precedes       -1
94084c
@@ -121,7 +121,9 @@ mon         "January";"February";"March";"April";"May";"June";"July";/
94084c
 %
94084c
 % ISO 8601 conforming applications should use the values 7, 19971201 (a
94084c
 % Monday), and 4 (Thursday), respectively.
94084c
-week    7;19971201;4
94084c
+%
94084c
+% This field is consciously aligned with the builtin C/POSIX locale.
94084c
+week    7;19971130;4
94084c
 first_weekday	1
94084c
 first_workday	2
94084c
 
94084c
@@ -129,7 +131,7 @@ first_workday	2
94084c
 d_t_fmt "%a %b %e %H:%M:%S %Y"
94084c
 
94084c
 % Appropriate date representation (%x)
94084c
-d_fmt   "%m/%d/%y"
94084c
+d_fmt   "%m//%d//%y"
94084c
 
94084c
 % Appropriate time representation (%X)
94084c
 t_fmt   "%H:%M:%S"
94084c
@@ -150,8 +152,8 @@ LC_MESSAGES
94084c
 %
94084c
 yesexpr "^[yY]"
94084c
 noexpr  "^[nN]"
94084c
-yesstr  "Yes"
94084c
-nostr   "No"
94084c
+yesstr  ""
94084c
+nostr   ""
94084c
 END LC_MESSAGES
94084c
 
94084c
 LC_PAPER
94084c
@@ -175,6 +177,10 @@ LC_ADDRESS
94084c
 % the LC_ADDRESS category.
94084c
 % (also used in the built in C/POSIX locale in glibc/locale/C-address.c)
94084c
 postal_fmt    "%a%N%f%N%d%N%b%N%s %h %e %r%N%C-%z %T%N%c%N"
94084c
+% The abbreviated 2 char and 3 char should be set to empty strings to
94084c
+% match the C/POSIX locale.
94084c
+country_ab2   ""
94084c
+country_ab3   ""
94084c
 END LC_ADDRESS
94084c
 
94084c
 LC_TELEPHONE
94084c
diff --git a/localedata/tst-c-utf8-consistency.c b/localedata/tst-c-utf8-consistency.c
94084c
new file mode 100644
94084c
index 0000000000000000..50feed3090df0ff1
94084c
--- /dev/null
94084c
+++ b/localedata/tst-c-utf8-consistency.c
94084c
@@ -0,0 +1,539 @@
94084c
+/* Test that C/POSIX and C.UTF-8 are consistent.
94084c
+   Copyright (C) 2022 Free Software Foundation, Inc.
94084c
+   This file is part of the GNU C Library.
94084c
+
94084c
+   The GNU C Library is free software; you can redistribute it and/or
94084c
+   modify it under the terms of the GNU Lesser General Public
94084c
+   License as published by the Free Software Foundation; either
94084c
+   version 2.1 of the License, or (at your option) any later version.
94084c
+
94084c
+   The GNU C Library is distributed in the hope that it will be useful,
94084c
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
94084c
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
94084c
+   Lesser General Public License for more details.
94084c
+
94084c
+   You should have received a copy of the GNU Lesser General Public
94084c
+   License along with the GNU C Library; if not, see
94084c
+   <https://www.gnu.org/licenses/>.  */
94084c
+
94084c
+#include <langinfo.h>
94084c
+#include <locale.h>
94084c
+#include <stdbool.h>
94084c
+#include <stdio.h>
94084c
+#include <support/check.h>
94084c
+
94084c
+/* Initialized by do_test using newlocale.  */
94084c
+static locale_t c_utf8;
94084c
+
94084c
+/* Set to true for second pass.  */
94084c
+static bool use_nl_langinfo_l;
94084c
+
94084c
+static void
94084c
+switch_to_c (void)
94084c
+{
94084c
+  if (setlocale (LC_ALL, "C") == NULL)
94084c
+    FAIL_EXIT1 ("setlocale (LC_ALL, \"C\")");
94084c
+}
94084c
+
94084c
+static void
94084c
+switch_to_c_utf8 (void)
94084c
+{
94084c
+  if (setlocale (LC_ALL, "C.UTF-8") == NULL)
94084c
+    FAIL_EXIT1 ("setlocale (LC_ALL, \"C.UTF-8\")");
94084c
+}
94084c
+
94084c
+static char *
94084c
+str (nl_item item)
94084c
+{
94084c
+  if (!use_nl_langinfo_l)
94084c
+    switch_to_c  ();
94084c
+  return nl_langinfo (item);
94084c
+}
94084c
+
94084c
+static char *
94084c
+str_utf8 (nl_item item)
94084c
+{
94084c
+  if (use_nl_langinfo_l)
94084c
+    return nl_langinfo_l (item, c_utf8);
94084c
+  else
94084c
+    {
94084c
+      switch_to_c_utf8  ();
94084c
+      return nl_langinfo (item);
94084c
+    }
94084c
+}
94084c
+
94084c
+static wchar_t *
94084c
+wstr (nl_item item)
94084c
+{
94084c
+  return (wchar_t *) str (item);
94084c
+}
94084c
+
94084c
+static wchar_t *
94084c
+wstr_utf8 (nl_item item)
94084c
+{
94084c
+  return (wchar_t *) str_utf8 (item);
94084c
+}
94084c
+
94084c
+static int
94084c
+byte (nl_item item)
94084c
+{
94084c
+  return (signed char) *str (item);
94084c
+}
94084c
+
94084c
+static int
94084c
+byte_utf8 (nl_item item)
94084c
+{
94084c
+  return (signed char) *str_utf8 (item);
94084c
+}
94084c
+
94084c
+static int
94084c
+word (nl_item item)
94084c
+{
94084c
+  union
94084c
+  {
94084c
+    char *ptr;
94084c
+    int word;
94084c
+  } u;
94084c
+  u.ptr = str (item);
94084c
+  return u.word;
94084c
+}
94084c
+
94084c
+static int
94084c
+word_utf8 (nl_item item)
94084c
+{
94084c
+  union
94084c
+  {
94084c
+    char *ptr;
94084c
+    int word;
94084c
+  } u;
94084c
+  u.ptr = str_utf8 (item);
94084c
+  return u.word;
94084c
+}
94084c
+
94084c
+static void
94084c
+one_pass (void)
94084c
+{
94084c
+  /* LC_TIME.  */
94084c
+  TEST_COMPARE_STRING (str (ABDAY_1), str_utf8 (ABDAY_1));
94084c
+  TEST_COMPARE_STRING (str (ABDAY_2), str_utf8 (ABDAY_2));
94084c
+  TEST_COMPARE_STRING (str (ABDAY_3), str_utf8 (ABDAY_3));
94084c
+  TEST_COMPARE_STRING (str (ABDAY_4), str_utf8 (ABDAY_4));
94084c
+  TEST_COMPARE_STRING (str (ABDAY_5), str_utf8 (ABDAY_5));
94084c
+  TEST_COMPARE_STRING (str (ABDAY_6), str_utf8 (ABDAY_6));
94084c
+  TEST_COMPARE_STRING (str (ABDAY_7), str_utf8 (ABDAY_7));
94084c
+
94084c
+  TEST_COMPARE_STRING (str (DAY_1), str_utf8 (DAY_1));
94084c
+  TEST_COMPARE_STRING (str (DAY_2), str_utf8 (DAY_2));
94084c
+  TEST_COMPARE_STRING (str (DAY_3), str_utf8 (DAY_3));
94084c
+  TEST_COMPARE_STRING (str (DAY_4), str_utf8 (DAY_4));
94084c
+  TEST_COMPARE_STRING (str (DAY_5), str_utf8 (DAY_5));
94084c
+  TEST_COMPARE_STRING (str (DAY_6), str_utf8 (DAY_6));
94084c
+  TEST_COMPARE_STRING (str (DAY_7), str_utf8 (DAY_7));
94084c
+
94084c
+  TEST_COMPARE_STRING (str (ABMON_1), str_utf8 (ABMON_1));
94084c
+  TEST_COMPARE_STRING (str (ABMON_2), str_utf8 (ABMON_2));
94084c
+  TEST_COMPARE_STRING (str (ABMON_3), str_utf8 (ABMON_3));
94084c
+  TEST_COMPARE_STRING (str (ABMON_4), str_utf8 (ABMON_4));
94084c
+  TEST_COMPARE_STRING (str (ABMON_5), str_utf8 (ABMON_5));
94084c
+  TEST_COMPARE_STRING (str (ABMON_6), str_utf8 (ABMON_6));
94084c
+  TEST_COMPARE_STRING (str (ABMON_7), str_utf8 (ABMON_7));
94084c
+  TEST_COMPARE_STRING (str (ABMON_8), str_utf8 (ABMON_8));
94084c
+  TEST_COMPARE_STRING (str (ABMON_9), str_utf8 (ABMON_9));
94084c
+  TEST_COMPARE_STRING (str (ABMON_10), str_utf8 (ABMON_10));
94084c
+  TEST_COMPARE_STRING (str (ABMON_11), str_utf8 (ABMON_11));
94084c
+  TEST_COMPARE_STRING (str (ABMON_12), str_utf8 (ABMON_12));
94084c
+
94084c
+  TEST_COMPARE_STRING (str (MON_1), str_utf8 (MON_1));
94084c
+  TEST_COMPARE_STRING (str (MON_2), str_utf8 (MON_2));
94084c
+  TEST_COMPARE_STRING (str (MON_3), str_utf8 (MON_3));
94084c
+  TEST_COMPARE_STRING (str (MON_4), str_utf8 (MON_4));
94084c
+  TEST_COMPARE_STRING (str (MON_5), str_utf8 (MON_5));
94084c
+  TEST_COMPARE_STRING (str (MON_6), str_utf8 (MON_6));
94084c
+  TEST_COMPARE_STRING (str (MON_7), str_utf8 (MON_7));
94084c
+  TEST_COMPARE_STRING (str (MON_8), str_utf8 (MON_8));
94084c
+  TEST_COMPARE_STRING (str (MON_9), str_utf8 (MON_9));
94084c
+  TEST_COMPARE_STRING (str (MON_10), str_utf8 (MON_10));
94084c
+  TEST_COMPARE_STRING (str (MON_11), str_utf8 (MON_11));
94084c
+  TEST_COMPARE_STRING (str (MON_12), str_utf8 (MON_12));
94084c
+
94084c
+  TEST_COMPARE_STRING (str (AM_STR), str_utf8 (AM_STR));
94084c
+  TEST_COMPARE_STRING (str (PM_STR), str_utf8 (PM_STR));
94084c
+
94084c
+  TEST_COMPARE_STRING (str (D_T_FMT), str_utf8 (D_T_FMT));
94084c
+  TEST_COMPARE_STRING (str (D_FMT), str_utf8 (D_FMT));
94084c
+  TEST_COMPARE_STRING (str (T_FMT), str_utf8 (T_FMT));
94084c
+  TEST_COMPARE_STRING (str (T_FMT_AMPM),
94084c
+                       str_utf8 (T_FMT_AMPM));
94084c
+
94084c
+  TEST_COMPARE_STRING (str (ERA), str_utf8 (ERA));
94084c
+  TEST_COMPARE_STRING (str (ERA_YEAR), str_utf8 (ERA_YEAR));
94084c
+  TEST_COMPARE_STRING (str (ERA_D_FMT), str_utf8 (ERA_D_FMT));
94084c
+  TEST_COMPARE_STRING (str (ALT_DIGITS), str_utf8 (ALT_DIGITS));
94084c
+  TEST_COMPARE_STRING (str (ERA_D_T_FMT), str_utf8 (ERA_D_T_FMT));
94084c
+  TEST_COMPARE_STRING (str (ERA_T_FMT), str_utf8 (ERA_T_FMT));
94084c
+  TEST_COMPARE (word (_NL_TIME_ERA_NUM_ENTRIES),
94084c
+                word_utf8 (_NL_TIME_ERA_NUM_ENTRIES));
94084c
+  /* No array elements, so nothing to compare for _NL_TIME_ERA_ENTRIES.  */
94084c
+  TEST_COMPARE (word (_NL_TIME_ERA_NUM_ENTRIES), 0);
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABDAY_1), wstr_utf8 (_NL_WABDAY_1));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABDAY_2), wstr_utf8 (_NL_WABDAY_2));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABDAY_3), wstr_utf8 (_NL_WABDAY_3));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABDAY_4), wstr_utf8 (_NL_WABDAY_4));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABDAY_5), wstr_utf8 (_NL_WABDAY_5));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABDAY_6), wstr_utf8 (_NL_WABDAY_6));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABDAY_7), wstr_utf8 (_NL_WABDAY_7));
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WDAY_1), wstr_utf8 (_NL_WDAY_1));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WDAY_2), wstr_utf8 (_NL_WDAY_2));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WDAY_3), wstr_utf8 (_NL_WDAY_3));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WDAY_4), wstr_utf8 (_NL_WDAY_4));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WDAY_5), wstr_utf8 (_NL_WDAY_5));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WDAY_6), wstr_utf8 (_NL_WDAY_6));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WDAY_7), wstr_utf8 (_NL_WDAY_7));
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_1), wstr_utf8 (_NL_WABMON_1));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_2), wstr_utf8 (_NL_WABMON_2));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_3), wstr_utf8 (_NL_WABMON_3));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_4), wstr_utf8 (_NL_WABMON_4));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_5), wstr_utf8 (_NL_WABMON_5));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_6), wstr_utf8 (_NL_WABMON_6));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_7), wstr_utf8 (_NL_WABMON_7));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_8), wstr_utf8 (_NL_WABMON_8));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_9), wstr_utf8 (_NL_WABMON_9));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_10), wstr_utf8 (_NL_WABMON_10));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_11), wstr_utf8 (_NL_WABMON_11));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABMON_12), wstr_utf8 (_NL_WABMON_12));
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_1), wstr_utf8 (_NL_WMON_1));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_2), wstr_utf8 (_NL_WMON_2));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_3), wstr_utf8 (_NL_WMON_3));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_4), wstr_utf8 (_NL_WMON_4));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_5), wstr_utf8 (_NL_WMON_5));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_6), wstr_utf8 (_NL_WMON_6));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_7), wstr_utf8 (_NL_WMON_7));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_8), wstr_utf8 (_NL_WMON_8));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_9), wstr_utf8 (_NL_WMON_9));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_10), wstr_utf8 (_NL_WMON_10));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_11), wstr_utf8 (_NL_WMON_11));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WMON_12), wstr_utf8 (_NL_WMON_12));
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WAM_STR), wstr_utf8 (_NL_WAM_STR));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WPM_STR), wstr_utf8 (_NL_WPM_STR));
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WD_T_FMT), wstr_utf8 (_NL_WD_T_FMT));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WD_FMT), wstr_utf8 (_NL_WD_FMT));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WT_FMT), wstr_utf8 (_NL_WT_FMT));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WT_FMT_AMPM),
94084c
+                            wstr_utf8 (_NL_WT_FMT_AMPM));
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WERA_YEAR), wstr_utf8 (_NL_WERA_YEAR));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WERA_D_FMT), wstr_utf8 (_NL_WERA_D_FMT));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALT_DIGITS),
94084c
+                            wstr_utf8 (_NL_WALT_DIGITS));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WERA_D_T_FMT),
94084c
+                            wstr_utf8 (_NL_WERA_D_T_FMT));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WERA_T_FMT), wstr_utf8 (_NL_WERA_T_FMT));
94084c
+
94084c
+  /* This is somewhat inconsistent, but see locale/categories.def.  */
94084c
+  TEST_COMPARE (byte (_NL_TIME_WEEK_NDAYS), byte_utf8 (_NL_TIME_WEEK_NDAYS));
94084c
+  TEST_COMPARE (word (_NL_TIME_WEEK_1STDAY),
94084c
+                word_utf8 (_NL_TIME_WEEK_1STDAY));
94084c
+  TEST_COMPARE (byte (_NL_TIME_WEEK_1STWEEK),
94084c
+                byte_utf8 (_NL_TIME_WEEK_1STWEEK));
94084c
+  TEST_COMPARE (byte (_NL_TIME_FIRST_WEEKDAY),
94084c
+                byte_utf8 (_NL_TIME_FIRST_WEEKDAY));
94084c
+  TEST_COMPARE (byte (_NL_TIME_FIRST_WORKDAY),
94084c
+                byte_utf8 (_NL_TIME_FIRST_WORKDAY));
94084c
+  TEST_COMPARE (byte (_NL_TIME_CAL_DIRECTION),
94084c
+                byte_utf8 (_NL_TIME_CAL_DIRECTION));
94084c
+  TEST_COMPARE_STRING (str (_NL_TIME_TIMEZONE), str_utf8 (_NL_TIME_TIMEZONE));
94084c
+
94084c
+  TEST_COMPARE_STRING (str (_DATE_FMT), str_utf8 (_DATE_FMT));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_W_DATE_FMT), wstr_utf8 (_NL_W_DATE_FMT));
94084c
+
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_TIME_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_TIME_CODESET), "UTF-8");
94084c
+
94084c
+  TEST_COMPARE_STRING (str (ALTMON_1), str_utf8 (ALTMON_1));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_2), str_utf8 (ALTMON_2));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_3), str_utf8 (ALTMON_3));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_4), str_utf8 (ALTMON_4));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_5), str_utf8 (ALTMON_5));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_6), str_utf8 (ALTMON_6));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_7), str_utf8 (ALTMON_7));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_8), str_utf8 (ALTMON_8));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_9), str_utf8 (ALTMON_9));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_10), str_utf8 (ALTMON_10));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_11), str_utf8 (ALTMON_11));
94084c
+  TEST_COMPARE_STRING (str (ALTMON_12), str_utf8 (ALTMON_12));
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_1), wstr_utf8 (_NL_WALTMON_1));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_2), wstr_utf8 (_NL_WALTMON_2));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_3), wstr_utf8 (_NL_WALTMON_3));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_4), wstr_utf8 (_NL_WALTMON_4));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_5), wstr_utf8 (_NL_WALTMON_5));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_6), wstr_utf8 (_NL_WALTMON_6));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_7), wstr_utf8 (_NL_WALTMON_7));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_8), wstr_utf8 (_NL_WALTMON_8));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_9), wstr_utf8 (_NL_WALTMON_9));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_10), wstr_utf8 (_NL_WALTMON_10));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_11), wstr_utf8 (_NL_WALTMON_11));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WALTMON_12), wstr_utf8 (_NL_WALTMON_12));
94084c
+
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_1), str_utf8 (_NL_ABALTMON_1));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_2), str_utf8 (_NL_ABALTMON_2));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_3), str_utf8 (_NL_ABALTMON_3));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_4), str_utf8 (_NL_ABALTMON_4));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_5), str_utf8 (_NL_ABALTMON_5));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_6), str_utf8 (_NL_ABALTMON_6));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_7), str_utf8 (_NL_ABALTMON_7));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_8), str_utf8 (_NL_ABALTMON_8));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_9), str_utf8 (_NL_ABALTMON_9));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_10), str_utf8 (_NL_ABALTMON_10));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_11), str_utf8 (_NL_ABALTMON_11));
94084c
+  TEST_COMPARE_STRING (str (_NL_ABALTMON_12), str_utf8 (_NL_ABALTMON_12));
94084c
+
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_1),
94084c
+                            wstr_utf8 (_NL_WABALTMON_1));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_2),
94084c
+                            wstr_utf8 (_NL_WABALTMON_2));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_3),
94084c
+                            wstr_utf8 (_NL_WABALTMON_3));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_4),
94084c
+                            wstr_utf8 (_NL_WABALTMON_4));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_5),
94084c
+                            wstr_utf8 (_NL_WABALTMON_5));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_6),
94084c
+                            wstr_utf8 (_NL_WABALTMON_6));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_7),
94084c
+                            wstr_utf8 (_NL_WABALTMON_7));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_8),
94084c
+                            wstr_utf8 (_NL_WABALTMON_8));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_9),
94084c
+                            wstr_utf8 (_NL_WABALTMON_9));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_10),
94084c
+                            wstr_utf8 (_NL_WABALTMON_10));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_11),
94084c
+                            wstr_utf8 (_NL_WABALTMON_11));
94084c
+  TEST_COMPARE_STRING_WIDE (wstr (_NL_WABALTMON_12),
94084c
+                            wstr_utf8 (_NL_WABALTMON_12));
94084c
+
94084c
+  /* LC_COLLATE.  Mostly untested, only expected differences.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_COLLATE_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_COLLATE_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_CTYPE.  Mostly untested, only expected differences.  */
94084c
+  TEST_COMPARE_STRING (str (CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_MONETARY.  */
94084c
+  TEST_COMPARE_STRING (str (INT_CURR_SYMBOL), str_utf8 (INT_CURR_SYMBOL));
94084c
+  TEST_COMPARE_STRING (str (CURRENCY_SYMBOL), str_utf8 (CURRENCY_SYMBOL));
94084c
+  TEST_COMPARE_STRING (str (MON_DECIMAL_POINT), str_utf8 (MON_DECIMAL_POINT));
94084c
+  TEST_COMPARE_STRING (str (MON_THOUSANDS_SEP), str_utf8 (MON_THOUSANDS_SEP));
94084c
+  TEST_COMPARE_STRING (str (MON_GROUPING), str_utf8 (MON_GROUPING));
94084c
+  TEST_COMPARE_STRING (str (POSITIVE_SIGN), str_utf8 (POSITIVE_SIGN));
94084c
+  TEST_COMPARE_STRING (str (NEGATIVE_SIGN), str_utf8 (NEGATIVE_SIGN));
94084c
+  TEST_COMPARE (byte (INT_FRAC_DIGITS), byte_utf8 (INT_FRAC_DIGITS));
94084c
+  TEST_COMPARE (byte (FRAC_DIGITS), byte_utf8 (FRAC_DIGITS));
94084c
+  TEST_COMPARE (byte (P_CS_PRECEDES), byte_utf8 (P_CS_PRECEDES));
94084c
+  TEST_COMPARE (byte (P_SEP_BY_SPACE), byte_utf8 (P_SEP_BY_SPACE));
94084c
+  TEST_COMPARE (byte (N_CS_PRECEDES), byte_utf8 (N_CS_PRECEDES));
94084c
+  TEST_COMPARE (byte (N_SEP_BY_SPACE), byte_utf8 (N_SEP_BY_SPACE));
94084c
+  TEST_COMPARE (byte (P_SIGN_POSN), byte_utf8 (P_SIGN_POSN));
94084c
+  TEST_COMPARE (byte (N_SIGN_POSN), byte_utf8 (N_SIGN_POSN));
94084c
+  TEST_COMPARE_STRING (str (CRNCYSTR), str_utf8 (CRNCYSTR));
94084c
+  TEST_COMPARE (byte (INT_P_CS_PRECEDES), byte_utf8 (INT_P_CS_PRECEDES));
94084c
+  TEST_COMPARE (byte (INT_P_SEP_BY_SPACE), byte_utf8 (INT_P_SEP_BY_SPACE));
94084c
+  TEST_COMPARE (byte (INT_N_CS_PRECEDES), byte_utf8 (INT_N_CS_PRECEDES));
94084c
+  TEST_COMPARE (byte (INT_N_SEP_BY_SPACE), byte_utf8 (INT_N_SEP_BY_SPACE));
94084c
+  TEST_COMPARE (byte (INT_P_SIGN_POSN), byte_utf8 (INT_P_SIGN_POSN));
94084c
+  TEST_COMPARE (byte (INT_N_SIGN_POSN), byte_utf8 (INT_N_SIGN_POSN));
94084c
+  TEST_COMPARE_STRING (str (_NL_MONETARY_DUO_INT_CURR_SYMBOL),
94084c
+                       str_utf8 (_NL_MONETARY_DUO_INT_CURR_SYMBOL));
94084c
+  TEST_COMPARE_STRING (str (_NL_MONETARY_DUO_CURRENCY_SYMBOL),
94084c
+                       str_utf8 (_NL_MONETARY_DUO_CURRENCY_SYMBOL));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_FRAC_DIGITS),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_FRAC_DIGITS));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_FRAC_DIGITS),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_FRAC_DIGITS));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_P_CS_PRECEDES),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_P_CS_PRECEDES));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_P_SEP_BY_SPACE),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_P_SEP_BY_SPACE));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_N_CS_PRECEDES),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_N_CS_PRECEDES));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_N_SEP_BY_SPACE),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_N_SEP_BY_SPACE));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_P_CS_PRECEDES),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_P_CS_PRECEDES));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_P_SEP_BY_SPACE),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_P_SEP_BY_SPACE));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_N_CS_PRECEDES),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_N_CS_PRECEDES));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_N_SEP_BY_SPACE),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_N_SEP_BY_SPACE));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_P_SIGN_POSN),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_P_SIGN_POSN));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_N_SIGN_POSN),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_N_SIGN_POSN));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_P_SIGN_POSN),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_P_SIGN_POSN));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_N_SIGN_POSN),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_N_SIGN_POSN));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_P_SIGN_POSN),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_P_SIGN_POSN));
94084c
+  TEST_COMPARE (byte (_NL_MONETARY_DUO_INT_N_SIGN_POSN),
94084c
+                byte_utf8 (_NL_MONETARY_DUO_INT_N_SIGN_POSN));
94084c
+  TEST_COMPARE (word (_NL_MONETARY_UNO_VALID_FROM),
94084c
+                word_utf8 (_NL_MONETARY_UNO_VALID_FROM));
94084c
+  TEST_COMPARE (word (_NL_MONETARY_UNO_VALID_TO),
94084c
+                word_utf8 (_NL_MONETARY_UNO_VALID_TO));
94084c
+  TEST_COMPARE (word (_NL_MONETARY_DUO_VALID_FROM),
94084c
+                word_utf8 (_NL_MONETARY_DUO_VALID_FROM));
94084c
+  TEST_COMPARE (word (_NL_MONETARY_DUO_VALID_TO),
94084c
+                word_utf8 (_NL_MONETARY_DUO_VALID_TO));
94084c
+  /* _NL_MONETARY_CONVERSION_RATE cannot be tested (word array).  */
94084c
+  TEST_COMPARE (word (_NL_MONETARY_DECIMAL_POINT_WC),
94084c
+                word_utf8 (_NL_MONETARY_DECIMAL_POINT_WC));
94084c
+  TEST_COMPARE (word (_NL_MONETARY_THOUSANDS_SEP_WC),
94084c
+                word_utf8 (_NL_MONETARY_THOUSANDS_SEP_WC));
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_MONETARY_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_MONETARY_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_NUMERIC.  */
94084c
+
94084c
+  TEST_COMPARE_STRING (str (DECIMAL_POINT), str_utf8 (DECIMAL_POINT));
94084c
+  TEST_COMPARE_STRING (str (RADIXCHAR), str_utf8 (RADIXCHAR));
94084c
+  TEST_COMPARE_STRING (str (THOUSANDS_SEP), str_utf8 (THOUSANDS_SEP));
94084c
+  TEST_COMPARE_STRING (str (THOUSEP), str_utf8 (THOUSEP));
94084c
+  TEST_COMPARE_STRING (str (GROUPING), str_utf8 (GROUPING));
94084c
+  TEST_COMPARE (word (_NL_NUMERIC_DECIMAL_POINT_WC),
94084c
+                word_utf8 (_NL_NUMERIC_DECIMAL_POINT_WC));
94084c
+  TEST_COMPARE (word (_NL_NUMERIC_THOUSANDS_SEP_WC),
94084c
+                word_utf8 (_NL_NUMERIC_THOUSANDS_SEP_WC));
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_NUMERIC_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_NUMERIC_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_MESSAGES.  */
94084c
+
94084c
+  TEST_COMPARE_STRING (str (YESEXPR), str_utf8 (YESEXPR));
94084c
+  TEST_COMPARE_STRING (str (NOEXPR), str_utf8 (NOEXPR));
94084c
+  TEST_COMPARE_STRING (str (YESSTR), str_utf8 (YESSTR));
94084c
+  TEST_COMPARE_STRING (str (NOSTR), str_utf8 (NOSTR));
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_MESSAGES_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_MESSAGES_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_PAPER.  */
94084c
+
94084c
+  TEST_COMPARE (word (_NL_PAPER_HEIGHT), word_utf8 (_NL_PAPER_HEIGHT));
94084c
+  TEST_COMPARE (word (_NL_PAPER_WIDTH), word_utf8 (_NL_PAPER_WIDTH));
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_PAPER_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_PAPER_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_NAME.  */
94084c
+
94084c
+  TEST_COMPARE_STRING (str (_NL_NAME_NAME_FMT),
94084c
+                       str_utf8 (_NL_NAME_NAME_FMT));
94084c
+  TEST_COMPARE_STRING (str (_NL_NAME_NAME_GEN),
94084c
+                       str_utf8 (_NL_NAME_NAME_GEN));
94084c
+  TEST_COMPARE_STRING (str (_NL_NAME_NAME_MR),
94084c
+                       str_utf8 (_NL_NAME_NAME_MR));
94084c
+  TEST_COMPARE_STRING (str (_NL_NAME_NAME_MRS),
94084c
+                       str_utf8 (_NL_NAME_NAME_MRS));
94084c
+  TEST_COMPARE_STRING (str (_NL_NAME_NAME_MISS),
94084c
+                       str_utf8 (_NL_NAME_NAME_MISS));
94084c
+  TEST_COMPARE_STRING (str (_NL_NAME_NAME_MS),
94084c
+                       str_utf8 (_NL_NAME_NAME_MS));
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_NAME_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_NAME_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_ADDRESS.  */
94084c
+
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_POSTAL_FMT),
94084c
+                       str_utf8 (_NL_ADDRESS_POSTAL_FMT));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_COUNTRY_NAME),
94084c
+                       str_utf8 (_NL_ADDRESS_COUNTRY_NAME));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_COUNTRY_POST),
94084c
+                       str_utf8 (_NL_ADDRESS_COUNTRY_POST));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_COUNTRY_AB2),
94084c
+                       str_utf8 (_NL_ADDRESS_COUNTRY_AB2));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_COUNTRY_AB3),
94084c
+                       str_utf8 (_NL_ADDRESS_COUNTRY_AB3));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_COUNTRY_CAR),
94084c
+                       str_utf8 (_NL_ADDRESS_COUNTRY_CAR));
94084c
+  TEST_COMPARE (word (_NL_ADDRESS_COUNTRY_NUM),
94084c
+                word_utf8 (_NL_ADDRESS_COUNTRY_NUM));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_COUNTRY_ISBN),
94084c
+                       str_utf8 (_NL_ADDRESS_COUNTRY_ISBN));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_LANG_NAME),
94084c
+                       str_utf8 (_NL_ADDRESS_LANG_NAME));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_LANG_AB),
94084c
+                       str_utf8 (_NL_ADDRESS_LANG_AB));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_LANG_TERM),
94084c
+                       str_utf8 (_NL_ADDRESS_LANG_TERM));
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_LANG_LIB),
94084c
+                       str_utf8 (_NL_ADDRESS_LANG_LIB));
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_ADDRESS_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_ADDRESS_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_TELEPHONE.  */
94084c
+
94084c
+  TEST_COMPARE_STRING (str (_NL_TELEPHONE_TEL_INT_FMT),
94084c
+                       str_utf8 (_NL_TELEPHONE_TEL_INT_FMT));
94084c
+  TEST_COMPARE_STRING (str (_NL_TELEPHONE_TEL_DOM_FMT),
94084c
+                       str_utf8 (_NL_TELEPHONE_TEL_DOM_FMT));
94084c
+  TEST_COMPARE_STRING (str (_NL_TELEPHONE_INT_SELECT),
94084c
+                       str_utf8 (_NL_TELEPHONE_INT_SELECT));
94084c
+  TEST_COMPARE_STRING (str (_NL_TELEPHONE_INT_PREFIX),
94084c
+                       str_utf8 (_NL_TELEPHONE_INT_PREFIX));
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_TELEPHONE_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_TELEPHONE_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_MEASUREMENT.  */
94084c
+
94084c
+  TEST_COMPARE (byte (_NL_MEASUREMENT_MEASUREMENT),
94084c
+                byte_utf8 (_NL_MEASUREMENT_MEASUREMENT));
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_MEASUREMENT_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_MEASUREMENT_CODESET), "UTF-8");
94084c
+
94084c
+  /* LC_IDENTIFICATION is skipped since C.UTF-8 is distinct from C.  */
94084c
+
94084c
+  /* _NL_IDENTIFICATION_CATEGORY cannot be tested because it is a
94084c
+     string array.  */
94084c
+  /* Expected difference.  */
94084c
+  TEST_COMPARE_STRING (str (_NL_IDENTIFICATION_CODESET), "ANSI_X3.4-1968");
94084c
+  TEST_COMPARE_STRING (str_utf8 (_NL_IDENTIFICATION_CODESET), "UTF-8");
94084c
+}
94084c
+
94084c
+static int
94084c
+do_test (void)
94084c
+{
94084c
+  puts ("info: using setlocale and nl_langinfo");
94084c
+  one_pass ();
94084c
+
94084c
+  puts ("info: using nl_langinfo_l");
94084c
+
94084c
+  c_utf8 = newlocale (LC_ALL_MASK, "C.UTF-8", (locale_t) 0);
94084c
+  TEST_VERIFY_EXIT (c_utf8 != (locale_t) 0);
94084c
+
94084c
+  switch_to_c ();
94084c
+  use_nl_langinfo_l = true;
94084c
+  one_pass ();
94084c
+
94084c
+  freelocale (c_utf8);
94084c
+
94084c
+  return 0;
94084c
+}
94084c
+
94084c
+#include <support/test-driver.c>