Hi there. When one uses strftime(3) to get a date string formated according to one's need, locale is not taken into account: the week day and month name are still in English. When one strace(1) a process that uses strftime(3), one can see that no access is done to open locale files. Examination of the source of strftime in glibc2 shows that the problem comes probably of a bad configuration of the GLIBC since strftime.c seems to be able to get locale thru _NL_CURRENT macro if correctly compiled. I did not report the bug to FSF/GNU yet because of that. Example of program showing the bug: #include <time.h> #include <stdio.h> main() { time_t Now=time(NULL); struct tm MyTm; char String[100]; memcpy(&MyTm,locatime(&Now),sizeof(struct tm)); strftime(String,sizeof(String)-1,"%A",&MyTm); printf("String=[%s]\n",String); } Run this program with LC_TIME=fr_FR (for instance) and you'll see still English output. strace this program and you'll see no file opened to get the locale. Same problem with RedHat 6.1 Thanks for your help.
as far as I know, you have to call setlocale(getenv("LC_ALL")) before you can use localized functions.
=== +#include <locale.h> + +setlocale(LC_ALL,""); === $ export LANG=fr_FR
Thanks guys. Being used to USVR4 where strftime(3) did not need any explicit call to setlocale(3) before its use, I reported a non-bug ;-(