1--TEST--
2Bug #77111 php-win.exe corrupts unicode symbols from cli parameters
3--SKIPIF--
4<?php
5include "skipif.inc";
6
7if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
8	die("skip this test is for Windows platforms only");
9}
10
11$php = dirname(getenv('TEST_PHP_EXECUTABLE')) . DIRECTORY_SEPARATOR . "php-win.exe";
12if (!file_exists($php)) {
13	die("skip php-win.exe doesn't exist");
14}
15
16?>
17--FILE--
18<?php
19
20$php = dirname(getenv('TEST_PHP_EXECUTABLE')) . DIRECTORY_SEPARATOR . "php-win.exe";
21
22$out_fl = dirname(__FILE__) . "\\argv_bug77111.txt";
23
24$argv_fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "argv_test.php";
25file_put_contents($argv_fl, "<?php file_put_contents('$out_fl', implode(' ', array_slice(\$argv, 1))); ?>");
26
27`$php -n $argv_fl Ästhetik Æstetik Esthétique Estética Эстетика`;
28var_dump(file_get_contents($out_fl));
29
30?>
31==DONE==
32--CLEAN--
33<?php
34$out_fl = dirname(__FILE__) . "\\argv_bug77111.txt";
35$argv_fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "argv_test.php";
36unlink($argv_fl);
37unlink($out_fl);
38?>
39--EXPECTF--
40string(57) "Ästhetik Æstetik Esthétique Estética Эстетика"
41==DONE==
42
43