1--TEST--
2Bug #54977 UTF-8 files and folder are not shown
3--SKIPIF--
4<?php
5include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
6
7skip_if_not_win();
8if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
9skip_if_no_required_exts();
10
11?>
12--FILE--
13<?php
14
15/* This file is in UTF-8. */
16
17include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
18
19$prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . "testBug54977" . DIRECTORY_SEPARATOR;
20
21$paths = array("多国語", "王", "汚れて掘る");
22
23mkdir($prefix);
24foreach ($paths as $d) {
25	mkdir($prefix . $d);
26	file_put_contents($prefix . $d . ".test", $d);
27}
28
29$myDirectory = opendir($prefix);
30while($entryName = readdir($myDirectory)) {
31	echo get_basename_with_cp($prefix . $entryName, 65001, false) . "\n";
32}
33closedir($myDirectory);
34
35foreach ($paths as $d) {
36	rmdir($prefix . $d);
37	unlink($prefix . $d . ".test");
38}
39rmdir($prefix);
40
41?>
42===DONE===
43--EXPECT--
44testBug54977
45windows_mb_path
46多国語
47多国語.test
48汚れて掘る
49汚れて掘る.test
5051王.test
52===DONE===
53