This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LOCALE ERROR


On Sun, Dec 07, 2003 at 09:15:28PM -0300, Marcelo Rezende Módolo <mrmodolo@terra.com.br> wrote:
> I read the man pages "man setlocale", "man strftime" and find a mistake 
> in str format.

Did you read the part about only the minimum locale support being present?

> I use ' if (!strftime((char *)str, 100, "%#x", (const struct tm 
> *)thetime))' but the correct is
> ' if (!strftime((char *)str, 100, "%x", (const struct tm *)thetime))'...
> But I still have the same output for all setlocale I use.
> setlocale(LC_ALL, "C");
> setlocale(LC_ALL, "pt_BR");
> setlocale(LC_ALL, "ja");
> ...
> $ ./crt_locale.exe
> 'Mon Dec 08 2003'
> 'Mon Dec 08 2003'
> 'Mon Dec 08 2003'
> 'Mon Dec 08 2003'

hint: setlocale returns NULL on error.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]