Back to index

glibc  2.9
tst-setlocale.c File Reference
#include <locale.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.


int main (void)

Function Documentation

int main ( void  )

Definition at line 7 of file tst-setlocale.c.

  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;

Here is the call graph for this function: