uconverter_oop_subst.phpt 498 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Basic UConverter::convert() w/ Subsitution
  3. --EXTENSIONS--
  4. intl
  5. --INI--
  6. intl.use_exceptions=false
  7. --FILE--
  8. <?php
  9. $c = new UConverter('ascii', 'utf-8');
  10. foreach(array('?','','<unknown>') as $subst) {
  11. if (!$c->setSubstChars($subst)) {
  12. echo "**Disallowed\n";
  13. continue;
  14. }
  15. var_dump($c->convert("This is an ascii string"));
  16. var_dump($c->convert("Snowman: (\xE2\x98\x83)"));
  17. }
  18. ?>
  19. --EXPECT--
  20. string(23) "This is an ascii string"
  21. string(12) "Snowman: (?)"
  22. **Disallowed
  23. **Disallowed