strftime returning date as null on en_IN locale
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I have one application in which I uses strftime to format the date returned by localtime_r api into current locale specific format. strftime works fine with all the locales but for en_IN/en_IN.utf8 locale it returns the date as null, which is making my application to behave improperly.
To demonstrate this I have create a small program, which prints the date in current locale format.
#include <stdio.h>
#include <time.h>
#include <locale.h>
int main ()
{
time_t rawtime=
struct tm l_time;
char stime[100]="";
setlocale(
printf ("Locale is: %s\n", setlocale(
time ( &rawtime );
localtime_
strftime(
printf ( "%s\n", stime);
return 0;
}
Now, on my system I have set the locale as en_IN and en_IN.utf8.
root@IWFVM00648
root@IWFVM00648
root@IWFVM00648
LANG=en_IN.utf8
LANGUAGE=en_IN:en
LC_CTYPE=
LC_NUMERIC=
LC_TIME=
LC_COLLATE=
LC_MONETARY=
LC_MESSAGES=
LC_PAPER=
LC_NAME=
LC_ADDRESS=
LC_TELEPHONE=
LC_MEASUREMENT=
LC_IDENTIFICATI
LC_ALL=en_IN.utf8
root@IWFVM00648
Locale is: en_IN.utf8
Date: ------------------> Date is not coming.
root@IWFVM00648
root@IWFVM00648
root@IWFVM00648
Locale is: en_IN
Date: ------------------> Date is not coming.
Now, the same program I ran with en_US.utf8 and I got the correct date output.
root@IWFVM00648
root@IWFVM00648
root@IWFVM00648
LANG=en_US.utf8
LANGUAGE=en_IN:en
LC_CTYPE=
LC_NUMERIC=
LC_TIME=
LC_COLLATE=
LC_MONETARY=
LC_MESSAGES=
LC_PAPER=
LC_NAME=
LC_ADDRESS=
LC_TELEPHONE=
LC_MEASUREMENT=
LC_IDENTIFICATI
LC_ALL=en_US.utf8
root@IWFVM00648
Locale is: en_US.utf8
Date: 11/29/2012
root@IWFVM00648
-------------> the same program I have used on other Linux distos, but there this problem does not shows.
Below are my system details:
Linux IWFVM00648 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
DISTRIB_ID=Ubuntu
DISTRIB_
DISTRIB_
DISTRIB_
Please let me know what can be the possible solution for this.
affects: | ubuntu → eglibc (Ubuntu) |