On Fri, Nov 27, 2009 at 10:20:12AM -0000, Steve Hay wrote:
> Nicholas Clark wrote on 2009-11-27:
> > On Fri, Nov 27, 2009 at 08:22:38AM -0000, Steve Hay wrote:
> >> Steve Hay wrote on 2009-11-27:

> >> I tried the test manually: the failure output is attached (in the hope
> >> that it is less likely to get mangled than if I copied and pasted it
> >> here).

Do not underestimate the capacity of the configuration of my mail client to
do this.

> > Content-Description: out.txt
> >>  #   Failed test 'strftime() can handle unicode chars in the format
> >> string' #   at t/time.t line 50. Wide character in print at
> >> ../../lib/Test/Builder.pm line 1698. #          got:
> >> '1970???01???%d???' #     expected: '1970???01???16???' # Looks like
> >> you failed 1 test of 13. ../ext/POSIX/t/time.t ..
> > 
> > I see just above that test:
> > 
> > # Careful!  strftime() is locale sensative.  Let's take care of that my
> > $orig_loc = setlocale(LC_TIME, "C") || die "Cannot setlocale() to C: $!";
> > 
> > Does Windows setlocale() return non-failure, but actually fail to do
> > anything?
> > 
> > (Hence strftime() is still running in a Japanese locale)
> > 
> 
> I think setlocale() works okay:
> 
> C:\gitclients\perl\t>..\perl -MPOSIX -e "print strftime('%#x', localtime), 
> qq[\n]; setlocale(LC_TIME, 'C'); print strftime('%#x', localtime)"
> 2009?$BG/11?$B7n27?$BF|
> Friday, November 27, 2009
> 

Strange. Then I don't understand. The test appears to be failing with the %d
failing to be interpolated, but the %Y and %m being handled just fine:

is(strftime("%Y\x{5e74}%m\x{6708}%d\x{65e5}", gmtime($jan_16)),
   "1970\x{5e74}01\x{6708}16\x{65e5}",
   "strftime() can handle unicode chars in the format string");

This makes no sense to me.

Nicholas Clark

Reply via email to