source: vendor/glibc-tests/glibc/stdlib/testmb2.c

Last change on this file was 2036, checked in by bird, 20 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 542 bytes
Line 
1/* 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}
Note: See TracBrowser for help on using the repository browser.