18 l
= newlocale (LC_ALL_MASK
, "de_DE.ISO-8859-1", NULL
);
21 puts ("newlocale failed");
25 memset (&tm
, '\0', sizeof (tm
));
31 if (strftime (buf
, sizeof (buf
), "%e %^B %Y", &tm
) == 0)
33 puts ("initial strftime failed");
36 if (strcmp (buf
, " 1 MARCH 2002") != 0)
38 printf ("initial strftime: expected \"%s\", got \"%s\"\n",
39 " 1 MARCH 2002", buf
);
43 printf ("got \"%s\"\n", buf
);
45 /* Now using the extended locale model. */
46 if (strftime_l (buf
, sizeof (buf
), "%e %^B %Y", &tm
, l
) == 0)
48 puts ("strftime_l failed");
51 else if (strcmp (buf
, " 1 M\xc4RZ 2002") != 0)
53 printf ("strftime_l: expected \"%s\", got \"%s\"\n",
54 " 1 M\xc4RZ 2002", buf
);
59 setlocale (LC_ALL
, "de_DE.ISO-8859-1");
60 printf ("got \"%s\"\n", buf
);
61 setlocale (LC_ALL
, "C");
64 /* And the wide character version. */
65 if (wcsftime_l (wbuf
, sizeof (wbuf
) / sizeof (wbuf
[0]), L
"%e %^B %Y", &tm
, l
)
68 puts ("wcsftime_l failed");
71 else if (wcscmp (wbuf
, L
" 1 M\x00c4RZ 2002") != 0)
73 printf ("wcsftime_l: expected \"%ls\", got \"%ls\"\n",
74 L
" 1 M\x00c4RZ 2002", wbuf
);
79 setlocale (LC_ALL
, "de_DE.ISO-8859-1");
80 printf ("got \"%ls\"\n", wbuf
);
81 setlocale (LC_ALL
, "C");