-# locale-zh.m4 serial 2
+# locale-zh.m4 serial 3
dnl Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
#if HAVE_LANGINFO_CODESET
# include <langinfo.h>
#endif
+#include <stdlib.h>
+#include <string.h>
struct tm t;
char buf[16];
int main ()
#if HAVE_LANGINFO_CODESET
if (nl_langinfo (CODESET) [0] == '\0') return 1;
#endif
+#ifdef __CYGWIN__
+ /* On Cygwin, avoid locale names without encoding suffix, because the
+ locale_charset() function relies on the encoding suffix. Note that
+ LC_ALL is set on the command line. */
+ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+#endif
/* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
This excludes the UTF-8 encoding. */
t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;