1--TEST--
2Test fopen() for write to cp932 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(932, "oem");
11
12?>
13--CONFLICTS--
14dir_cp932
15--INI--
16internal_encoding=cp932
17--FILE--
18<?php
19/*
20#vim: set fileencoding=cp932
21#vim: set encoding=cp932
22*/
23
24include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
25
26$item = "�e�X�g�}���`�o�C�g�E�p�X"; // cp932 string
27$prefix = create_data("dir_cp932", "{$item}42}", 932);
28$fn = $prefix . DIRECTORY_SEPARATOR . "{$item}33";
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, 932);
41
42remove_data("dir_cp932");
43
44?>
45--EXPECTF--
46resource(%d) of type (stream)
47int(25)
48bool(true)
49string(25) "writing to an mb filename"
50Active code page: 932
51getting basename of %s\�e�X�g�}���`�o�C�g�E�p�X33
52string(%d) "�e�X�g�}���`�o�C�g�E�p�X33"
53bool(true)
54string(%d) "%s\�e�X�g�}���`�o�C�g�E�p�X33"
55Active code page: %d
56