argv_mb_bug77111.phpt 1.0 KB

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