diff --git a/t/2_variant.t b/t/2_variant.t index ee395ab..8093459 100644 --- a/t/2_variant.t +++ b/t/2_variant.t @@ -214,8 +214,10 @@ printf "ok %d\n", ++$Test; Win32::OLE->Option(LCID => $lcidEnglish); $v = Variant(VT_DATE, "1 may 1999 17:00"); my $str = $v->Date(DATE_LONGDATE); -print "# LONGDATE is '$str'\n"; -print "not " unless $str eq 'Saturday, May 01, 1999'; +unless ($str eq 'Saturday, May 01, 1999' || $str eq 'Saturday, May 1, 1999') { + print STDERR "# LONGDATE is '$str'\n"; + print "not " ; +} printf "ok %d\n", ++$Test; # 28. GetDateFormat with formating string diff --git a/t/3_ole.t b/t/3_ole.t index d29db22..2c1691b 100644 --- a/t/3_ole.t +++ b/t/3_ole.t @@ -63,6 +63,8 @@ open(ME,$0) or die $!; my $TestCount = grep(/\+\+\$Test/,); close(ME); +my $oemcp = GetLocaleInfo(GetSystemDefaultLCID(), LOCALE_IDEFAULTCODEPAGE); + sub stringify { my $arg = shift; return "" unless defined $arg; @@ -366,11 +368,23 @@ print "# Value is \"$Value\"\n"; print "not " unless $Value eq 'CamelPerl3.1415'; printf "ok %d\n", ++$Test; +if ($oemcp == 866) { + my ($Version) = $Excel->{Version} =~ /([0-9.]+)/; + print "# Excel version is $Version\n"; + + my $LCID = MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL)); + $LCID = MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)) if $Version >= 8; + $Excel::LCID = $LCID; +} + # 34. Set a cell formula and retrieve calculated value $Sheet->Cells(3,1)->{Formula} = '=PI()'; $Value = $Sheet->Cells(3,1)->{Value}; -print "# Value is \"$Value\"\n"; -print "not " unless abs($Value-3.141592) < 0.00001; +unless (abs($Value-3.141592) < 0.00001) { + print STDERR "#OEM codepage $oemcp\n"; + print STDERR "# Value is \"$Value\"\n"; + print "not "; +} printf "ok %d\n", ++$Test; # 35. Add single worksheet and check that worksheet count is incremented @@ -434,7 +448,6 @@ undef @Properties; # 42. Translate character from ANSI -> OEM ++$Test; -my $oemcp = GetLocaleInfo(GetSystemDefaultLCID(), LOCALE_IDEFAULTCODEPAGE); if ($oemcp == 437 || $oemcp == 850) { my ($Version) = $Excel->{Version} =~ /([0-9.]+)/; print "# Excel version is $Version\n";