+2024-05-27 Bruno Haible <bruno@clisp.org>
+
+ tests: Don't test on the broken NetBSD 10.0 zh_CN.GB18030 locale.
+ * m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Add a sanity check with mbrtowc.
+
2024-05-25 Bruno Haible <bruno@clisp.org>
euidaccess: Fix test failure on native Windows.
-# locale-zh.m4 serial 16
-dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
+# locale-zh.m4 serial 16.1
+dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
#endif
#include <stdlib.h>
#include <string.h>
+#include <wchar.h>
struct tm t;
char buf[16];
int main ()
single wide character. This excludes the GB2312 and GBK encodings. */
if (mblen ("\203\062\332\066", 5) != 4)
return 1;
+ /* Check whether mbrtowc accept this character one byte at a time.
+ This excludes NetBSD 10.0. */
+ if (sizeof (wchar_t) > 2)
+ {
+ wchar_t wc;
+ mbstate_t state;
+ memset (&state, 0, sizeof (state));
+ if (!(mbrtowc (&wc, "\203", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\062", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\332", 1, &state) == (size_t)(-2)
+ && mbrtowc (&wc, "\066", 1, &state) == 1))
+ return 1;
+ }
return 0;
#endif
}