|
Packit Service |
82fcde |
/* Test case by Miloslav Trmac <mitr@volny.cz>. */
|
|
Packit Service |
82fcde |
#include <locale.h>
|
|
Packit Service |
82fcde |
#include <stdint.h>
|
|
Packit Service |
82fcde |
#include <stdlib.h>
|
|
Packit Service |
82fcde |
#include <stdio.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
int
|
|
Packit Service |
82fcde |
main (void)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
wchar_t wc;
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
if (setlocale (LC_CTYPE, "de_DE.UTF-8") == NULL)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
puts ("setlocale failed");
|
|
Packit Service |
82fcde |
return 1;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
if (mbtowc (&wc, "\xc3\xa1", MB_CUR_MAX) != 2 || wc != 0xE1)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
puts ("1st mbtowc failed");
|
|
Packit Service |
82fcde |
return 1;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
if (mbtowc (&wc, "\xc3\xa1", SIZE_MAX) != 2 || wc != 0xE1)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
puts ("2nd mbtowc failed");
|
|
Packit Service |
82fcde |
return 1;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return 0;
|
|
Packit Service |
82fcde |
}
|