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