1--TEST--
2Test fopen() for write eucjp 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();
10
11?>
12--CONFLICTS--
13dir_eucjp
14--FILE--
15<?php
16/*
17#vim: set fileencoding=eucjp
18#vim: set encoding=eucjp
19*/
20
21include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
22
23$item = iconv('eucjp', 'utf-8', "�ƥ��ȥޥ���Х��ȡ��ѥ�"); // EUCJP string
24$prefix = create_data("dir_eucjp", "{$item}42}");
25$fn = $prefix . DIRECTORY_SEPARATOR . "{$item}33";
26
27$f = fopen($fn, 'w');
28if ($f) {
29    var_dump($f, fwrite($f, "writing to an mb filename"));
30    var_dump(fclose($f));
31} else {
32    echo "open utf8 failed\n";
33}
34
35var_dump(file_get_contents($fn));
36
37get_basename_with_cp($fn, 65001);
38
39remove_data("dir_eucjp");
40
41?>
42--EXPECTF--
43resource(%d) of type (stream)
44int(25)
45bool(true)
46string(25) "writing to an mb filename"
47Active code page: 65001
48getting basename of %s\テストマルチバイト・パス33
49string(38) "テストマルチバイト・パス33"
50bool(true)
51string(%d) "%s\テストマルチバイト・パス33"
52Active code page: %d
53