Re: [rt.cpan.org #66751] make test fails on cygwin

[email protected] (Andjelkovic Toni RBS sIT)
Newsgroups perl.libwin32
Message-ID <[email protected]>
The test fails because readdir() on Cygwin returns a scalar containing UTF8,
but it does not set the scalar's UTF-8 flag. It helps to set the flag
explicitely:

--- t/Unicode.t.bak     2011-08-26 16:37:11.483644100 +0200
+++ t/Unicode.t 2011-08-26 16:45:10.802566000 +0200
@@ -1,5 +1,6 @@
 use strict;
 use Test;
+use Encode;
 use Cwd qw(cwd);
 use Win32;

@@ -48,6 +49,7 @@
 ok(opendir(my $dh, Win32::GetANSIPathName($dir)));
 while ($_ = readdir($dh)) {
     next if /^\./;
+    Encode::_utf8_on($_) if $^O eq "cygwin";
     ok($file, Win32::GetLongPathName("$dir\\$_"));
 }
 closedir($dh);

--
Toni Andjelkovic
s IT Solutions
Risk and Balance Sheet Management Solutions

s IT Solutions AT Spardat GmbH
A-1010 Wien, Werdertorgasse 5
Phone: +43 (0) 50100 - 16558
Fax: +43 (0) 50100 9 - 16558
mailto:[email protected]
http://www.s-itsolutions.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.