1--TEST--
2Bug #61315 stat() fails with specific DBCS characters
3--SKIPIF--
4<?php
5include __DIR__ . 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 __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
18
19$prefix = __DIR__ . DIRECTORY_SEPARATOR . "testBug61315" . DIRECTORY_SEPARATOR;
20
21$d0 = $prefix . "ソフト";
22$d1 = $prefix . "フォルダ";
23
24mkdir($prefix);
25
26mkdir($d0);
27mkdir($d1);
28
29get_basename_with_cp($d0, 65001);
30get_basename_with_cp($d1, 65001);
31
32touch("$d0\\test0.txt");
33touch("$d1\\test1.txt");
34
35var_dump(count(stat("$d0\\test0.txt")) > 0);
36var_dump(count(stat("$d0\\test0.txt")) > 0);
37
38unlink("$d0\\test0.txt");
39unlink("$d1\\test1.txt");
40
41rmdir($d0);
42rmdir($d1);
43
44rmdir($prefix);
45
46?>
47--EXPECTF--
48Active code page: 65001
49getting basename of %s\ソフト
50string(9) "ソフト"
51bool(true)
52string(%d) "%s\ソフト"
53Active code page: %d
54Active code page: 65001
55getting basename of %s\フォルダ
56string(12) "フォルダ"
57bool(true)
58string(%d) "%s\フォルダ"
59Active code page: %d
60bool(true)
61bool(true)
62