Skip to content

Commit 2d7d14e

Browse files
committed
On Cygwin 1.7 readdir() returns utf8-encoded filenames
but doesn't set the SvUTF8 bit on the result.
1 parent df3de09 commit 2d7d14e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Revision history for the Perl extension Win32.
44
- add Win32::GetACP(), Win32::GetConsoleCP(),
55
Win32::GetConsoleOutputCP(), Win32::GetOEMCP(), Win32::SetConsoleCP()
66
and Win32::SetConsoleOutputCP(). [rt#78820] (Steve Hay)
7+
- adjust t/Unicode.t for Cygwin 1.7, where readdir() returns
8+
the utf8 encoded filename without setting the SvUTF8 flag [rt#66751]
9+
[rt#74332]
710

811
0.44 [2011-01-12]
912
- fix memory leak introduced in 0.43

t/Unicode.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use strict;
22
use Test;
3+
use Config qw(%Config);
34
use Cwd qw(cwd);
5+
use Encode qw();
46
use Win32;
57

68
BEGIN {
@@ -48,6 +50,9 @@ ok(-f Win32::GetANSIPathName($file));
4850
ok(opendir(my $dh, Win32::GetANSIPathName($dir)));
4951
while ($_ = readdir($dh)) {
5052
next if /^\./;
53+
# On Cygwin 1.7 readdir() returns the utf8 representation of the
54+
# filename but doesn't turn on the SvUTF8 bit
55+
Encode::_utf8_on($_) if $^O eq "cygwin" && $Config{osvers} !~ /^1.5/;
5156
ok($file, Win32::GetLongPathName("$dir\\$_"));
5257
}
5358
closedir($dh);

0 commit comments

Comments
 (0)