htmlentities15.phpt 665 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. htmlentities() test 15 (setlocale / KOI8-R)
  3. --INI--
  4. output_handler=
  5. default_charset=
  6. mbstring.internal_encoding=pass
  7. --SKIPIF--
  8. <?php
  9. $result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
  10. if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
  11. die("skip setlocale() failed\n");
  12. }
  13. ?>
  14. --DESCRIPTION--
  15. As of PHP 5.4, htmlentities() no longer makes replacements with numerical
  16. entities. Hence, for this input there's no substitution.
  17. --FILE--
  18. <?php
  19. setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
  20. $str = "ÒÏÓËÏÛÎÙÊ";
  21. var_dump($str, htmlentities($str, ENT_QUOTES, ''));
  22. ?>
  23. --EXPECT--
  24. string(9) "ÒÏÓËÏÛÎÙÊ"
  25. string(9) "ÒÏÓËÏÛÎÙÊ"