[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new module 'setlocale'
From: |
Bruno Haible |
Subject: |
Re: new module 'setlocale' |
Date: |
Fri, 18 Feb 2011 04:23:24 +0100 |
User-agent: |
KMail/1.9.9 |
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>
- locale dependent tests on mingw, Bruno Haible, 2011/02/12
- new module 'setlocale', Bruno Haible, 2011/02/12
- Re: new module 'setlocale', Bruno Haible, 2011/02/12
- Re: new module 'setlocale', Bruno Haible, 2011/02/12
- Re: new module 'setlocale', Eric Blake, 2011/02/17
- Re: new module 'setlocale', Bruno Haible, 2011/02/17
- Re: new module 'setlocale', Eric Blake, 2011/02/17
- Re: new module 'setlocale',
Bruno Haible <=
- Re: new module 'setlocale', Eric Blake, 2011/02/18
Re: locale dependent tests on mingw, Ben Pfaff, 2011/02/12