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 = __DIR__ . "\\argv_bug77111.txt";
23
24$argv_fl = __DIR__ . DIRECTORY_SEPARATOR . "argv_bug77111_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--CLEAN--
32<?php
33$out_fl = __DIR__ . "\\argv_bug77111.txt";
34$argv_fl = __DIR__ . DIRECTORY_SEPARATOR . "argv_bug77111_test.php";
35unlink($argv_fl);
36unlink($out_fl);
37?>
38--EXPECT--
39string(57) "Ästhetik Æstetik Esthétique Estética Эстетика"
40
41