1--TEST--
2Test fopen() for write big5 to UTF-8 path
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();
10skip_if_wrong_cp(950, "ansi");
11
12?>
13--INI--
14defalut_charset=cp950
15--FILE--
16<?php
17/*
18#vim: set fileencoding=big5
19#vim: set encoding=big5
20*/
21
22include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc";
23
24$item = "���զh�r�`���|"; // BIG5 string
25$prefix = create_data("file_big5", $item . "25", 950);
26$fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25";
27
28$f = fopen($fn, 'w');
29if ($f) {
30	var_dump($f, fwrite($f, "writing to an mb filename"));
31	var_dump(fclose($f));
32} else {
33	echo "open utf8 failed\n";
34}
35
36var_dump(file_get_contents($fn));
37
38get_basename_with_cp($fn, 950);
39
40var_dump(unlink($fn));
41
42remove_data("file_big5");
43
44?>
45===DONE===
46--EXPECTF--
47resource(%d) of type (stream)
48int(25)
49bool(true)
50string(25) "writing to an mb filename"
51Active code page: 950
52getting basename of %s���զh�r�`���|25
53string(%d) "���զh�r�`���|25"
54bool(true)
55string(%d) "%s測試多字節路徑25"
56Active code page: %d
57bool(true)
58===DONE===
59