blob: 3a3e3546295fd0e67b685d17cde98644182c3a13 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001/* Test case by Miloslav Trmac <mitr@volny.cz>. */
2#include <locale.h>
3#include <stdint.h>
4#include <stdlib.h>
5#include <stdio.h>
6
7int
8main (void)
9{
10 wchar_t wc;
11
12 if (setlocale (LC_CTYPE, "de_DE.UTF-8") == NULL)
13 {
14 puts ("setlocale failed");
15 return 1;
16 }
17
18 if (mbtowc (&wc, "\xc3\xa1", MB_CUR_MAX) != 2 || wc != 0xE1)
19 {
20 puts ("1st mbtowc failed");
21 return 1;
22 }
23
24 if (mbtowc (&wc, "\xc3\xa1", SIZE_MAX) != 2 || wc != 0xE1)
25 {
26 puts ("2nd mbtowc failed");
27 return 1;
28 }
29
30 return 0;
31}