1--TEST--
2Bug #76335 "link(): Bad file descriptor" with non-ASCII path
3--SKIPIF--
4<?php
5if(substr(PHP_OS, 0, 3) != 'WIN' ) {
6    die('skip windows only test');
7}
8?>
9--FILE--
10<?php
11
12$d0 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "á";
13$d1 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "a";
14
15$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "file";
16
17$l0 = $d0 . DIRECTORY_SEPARATOR . "b";
18$l1 = $d1 . DIRECTORY_SEPARATOR . "b";
19
20mkdir($d0);
21mkdir($d1);
22
23file_put_contents($fn, "");
24
25chdir($d0);
26var_dump(link($d0 . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "file", $l0));
27
28chdir($d1);
29var_dump(link($d1 . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "file", $l1));
30
31?>
32--CLEAN--
33<?php
34
35$d0 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "á";
36$d1 = dirname(__FILE__) . DIRECTORY_SEPARATOR . "a";
37
38$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . "file";
39
40$l0 = $d0 . DIRECTORY_SEPARATOR . "b";
41$l1 = $d1 . DIRECTORY_SEPARATOR . "b";
42
43unlink($l0);
44unlink($l1);
45unlink($fn);
46rmdir($d0);
47rmdir($d1);
48?>
49--EXPECT--
50bool(true)
51bool(true)
52