argv_mb_bug77111.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 = dirname(__FILE__) . "\\argv_bug77111.txt";
  18. $argv_fl = dirname(__FILE__) . 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. ==DONE==
  24. --CLEAN--
  25. <?php
  26. $out_fl = dirname(__FILE__) . "\\argv_bug77111.txt";
  27. $argv_fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "argv_test.php";
  28. unlink($argv_fl);
  29. unlink($out_fl);
  30. ?>
  31. --EXPECTF--
  32. string(57) "Ästhetik Æstetik Esthétique Estética Эстетика"
  33. ==DONE==