1--TEST--Bug #64506 2PHP can not read or write file correctly if file name have special char like š 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(); 10 11?> 12--FILE-- 13<?php 14/* 15#vim: set fileencoding=UTF-8 16#vim: set encoding=UTF-8 17*/ 18 19include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc"; 20 21$fnw = dirname(__FILE__) . DIRECTORY_SEPARATOR . "š.txt"; // UTF-8 22 23$f = fopen($fnw, 'w'); 24if ($f) { 25 var_dump($f, fwrite($f, "writing to an mb filename")); 26} else { 27 echo "open utf8 failed\n"; 28} 29var_dump(fclose($f)); 30 31var_dump(file_get_contents($fnw)); 32 33get_basename_with_cp($fnw, 65001); 34 35var_dump(unlink($fnw)); 36 37?> 38===DONE=== 39--EXPECTF-- 40resource(%d) of type (stream) 41int(25) 42bool(true) 43string(25) "writing to an mb filename" 44Active code page: 65001 45getting basename of %s\š.txt 46string(6) "š.txt" 47bool(true) 48string(%d) "%s\š.txt" 49Active code page: %d 50bool(true) 51===DONE=== 52