Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Sun, 7 Dec 2003 16:36:45 -0800
From: Yitzchak Scott-Thoennes <sthoenna@efn.org>
To: cygwin@cygwin.com
Subject: Re: LOCALE ERROR
Message-ID: <20031208003645.GA3252@efn.org>
References: <3FD3502C.2020600@terra.com.br> <Pine.GSO.4.56.0312071506150.16580@slinky.cs.nyu.edu> <3FD3C2A0.4050208@terra.com.br>
Mime-Version: 1.0
Content-Type: text/plain; charset=unknown-8bit
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <3FD3C2A0.4050208@terra.com.br>
User-Agent: Mutt/1.4i
Organization: bs"d

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/

