summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt
blob: 8d32f88a8cdcfb88431804f967b569a0743d2224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
--TEST--
Thai UTF-8 basic test
--SKIPIF--
<?php
include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";

skip_if_not_win();
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
skip_if_no_required_exts();

?>
--FILE--
<?php
/*
#vim: set fileencoding=cp874
#vim: set encoding=cp874
*/

include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";

$names = array( /* cp874 */
	"跴ͺ1",
	"跴ͺ2",
	"跴ͺ3",
	"跴ͺ4",
	"跴ͺ5",
	"跴ͺ6",
	"跴ͺ7",
	"跴ͺ8",
	"跴ͺ8 10",
);

$i = 0;
foreach ($names as $name) {
	$pathw = dirname(__FILE__) . DIRECTORY_SEPARATOR . iconv('cp874', 'utf-8', $name) . ".txt";

	file_put_contents($pathw, "hello" . $i++);

	get_basename_with_cp($pathw, 65001);
	var_dump(file_get_contents($pathw));

	unlink($pathw);
}

?>
===DONE===
--EXPECTF--	
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ1.txt
string(%d) "เป็นแฟ้มที่ทดสอบ1.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ1.txt"
Active code page: %d
string(6) "hello0"
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ2.txt
string(%d) "เป็นแฟ้มที่ทดสอบ2.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ2.txt"
Active code page: %d
string(6) "hello1"
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ3.txt
string(%d) "เป็นแฟ้มที่ทดสอบ3.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ3.txt"
Active code page: %d
string(6) "hello2"
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ4.txt
string(%d) "เป็นแฟ้มที่ทดสอบ4.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ4.txt"
Active code page: %d
string(6) "hello3"
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ5.txt
string(%d) "เป็นแฟ้มที่ทดสอบ5.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ5.txt"
Active code page: %d
string(6) "hello4"
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ6.txt
string(%d) "เป็นแฟ้มที่ทดสอบ6.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ6.txt"
Active code page: %d
string(6) "hello5"
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ7.txt
string(%d) "เป็นแฟ้มที่ทดสอบ7.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ7.txt"
Active code page: %d
string(6) "hello6"
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ8.txt
string(%d) "เป็นแฟ้มที่ทดสอบ8.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ8.txt"
Active code page: %d
string(6) "hello7"
Active code page: %d
getting basename of %sเป็นแฟ้มที่ทดสอบ8 10.txt
string(%d) "เป็นแฟ้มที่ทดสอบ8 10.txt"
bool(true)
string(%d) "%sเป็นแฟ้มที่ทดสอบ8 10.txt"
Active code page: %d
string(6) "hello8"
===DONE===