1--TEST--
2Test rename() with a dir for multibyte filenames
3--SKIPIF--
4<?php
5
6include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
7
8
9skip_if_not_win();
10if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
11skip_if_no_required_exts();
12
13
14?>
15--CONFLICTS--
16file2_mb
17--FILE--
18<?php
19
20
21include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
22
23
24$prefix = create_data("file2_mb");
25
26$fw_orig = $prefix . DIRECTORY_SEPARATOR . "Ελλάδα.txt";
27
28
29
30$fw_copied = $prefix . DIRECTORY_SEPARATOR . "Ελλάδα_copy.txt";
31
32
33$fw_renamed = $prefix . DIRECTORY_SEPARATOR . "測試多字節路徑17.txt";
34
35
36
37$old_cp = get_active_cp();
38
39set_active_cp(65001);
40
41
42
43
44
45var_dump(copy($fw_orig, $fw_copied));
46var_dump(get_basename_with_cp($fw_copied, get_active_cp(), false));
47var_dump(file_exists($fw_copied));
48
49var_dump(rename($fw_copied, $fw_renamed));
50var_dump(get_basename_with_cp($fw_renamed, get_active_cp(), false));
51var_dump(file_exists($fw_renamed));
52
53var_dump(unlink($fw_renamed));
54
55set_active_cp($old_cp);
56
57remove_data("file2_mb");
58
59?>
60--EXPECTF--
61Active code page: 65001
62bool(true)
63string(21) "Ελλάδα_copy.txt"
64bool(true)
65bool(true)
66string(27) "測試多字節路徑17.txt"
67bool(true)
68bool(true)
69Active code page: %d
70