about summary refs log tree commit diff
path: root/localedata/tst-setlocale.c
blob: 4b15100172cb310f821eb31efbd779882cca2daa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <locale.h>
#include <stdio.h>
#include <string.h>

static int
do_test (void)
{
  char q[30];
  char *s;

  setlocale (LC_ALL, "");
  printf ("after setlocale (LC_ALL, \"\"): %s\n", setlocale(LC_NUMERIC, NULL));

  strcpy (q, "de_DE.UTF-8");
  setlocale (LC_NUMERIC, q);
  printf ("after setlocale (LC_NUMERIC, \"%s\"): %s\n",
	  q, setlocale(LC_NUMERIC, NULL));

  strcpy (q, "de_DE.ISO-8859-1");
  s = setlocale (LC_NUMERIC, NULL);
  printf ("after overwriting string: %s\n", s);

  return strcmp (s, "de_DE.UTF-8") != 0;
}

#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"