Eric Blake wrote:
> > #include <locale.h>
> > #include <stdio.h>
> > #include <stdlib.h> 
> > #include <string.h>
> > 
> > int
> > main ()
> > {
> >   if (setlocale (LC_ALL, "ar_SA.ISO-8859-1") != NULL)
> >     {
> >       printf ("%s\n", setlocale (LC_ALL, NULL));
> >       printf ("%s\n", setlocale (LC_CTYPE, NULL));
> >     }
> >   return 0;
> > }
> 
> This outputs nothing; setlocale failed.

Huh? This is surprising. And what does this program show?

#include <locale.h>
#include <stdio.h>
#include <stdlib.h> 
#include <string.h>

int
main ()
{
  setenv ("LC_ALL", "ar_SA.ISO-8859-1", 1);
  if (setlocale (LC_ALL, "") != NULL)
    {
      printf ("%s\n", setlocale (LC_ALL, NULL));
      printf ("%s\n", setlocale (LC_CTYPE, NULL));
    }
  return 0;
}

Bruno
-- 
In memoriam Giordano Bruno <http://en.wikipedia.org/wiki/Giordano_Bruno>

Reply via email to