1--TEST--
2Test fopen() for reading cp1256 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(1256, "ansi");
11
12?>
13--CONFLICTS--
14file_cp1256
15--INI--
16internal_encoding=cp1256
17--FILE--
18<?php
19/*
20#vim: set fileencoding=cp1256
21#vim: set encoding=cp1256
22*/
23
24include __DIR__ . DIRECTORY_SEPARATOR . "util.inc";
25
26$item = "���� ����� ������ ������"; // cp1256 string
27$prefix = create_data("file_cp1256", $item, 1256);
28$fn = $prefix . DIRECTORY_SEPARATOR . $item;
29
30$f = fopen($fn, 'r');
31if ($f) {
32    var_dump($f, fread($f, 42));
33    var_dump(fclose($f));
34} else {
35    echo "open utf8 failed\n";
36}
37
38remove_data("file_cp1256");
39
40?>
41--EXPECTF--
42resource(%d) of type (stream)
43string(37) "reading file wihh multibyte filename
44"
45bool(true)
46