translit-failure.phpt 741 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Translit failure
  3. --EXTENSIONS--
  4. iconv
  5. --SKIPIF--
  6. <?php
  7. ( ICONV_IMPL != "libiconv" ) and die("skip ICONV_IMPL != \"libiconv\"");
  8. ?>
  9. --INI--
  10. error_reporting=2039
  11. --FILE--
  12. <?php
  13. // Should be ok.
  14. // Content from file is from libiconv testkit. Tested both
  15. // with a string as an implode, no difference.
  16. // if at some point internal encoding changes, set correct one
  17. // in INI section or use file 'TranslitFail1.ISO-8859-1'.
  18. set_time_limit(5);
  19. /*
  20. * The bug (fixed in libiconv 1.8) was confirmed that iconv goes into an
  21. * infinite loop when ASCII//TRANSLIT is performed. We should stop it in
  22. * some time.
  23. */
  24. $test = 'Écrit par %s.';
  25. var_dump(iconv("ISO-8859-1", "ASCII//TRANSLIT", $test));
  26. ?>
  27. --EXPECT--
  28. string(14) "'Ecrit par %s."