imap_8bit_basic.phpt 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Test imap_8bit() function : basic functionality
  3. --SKIPIF--
  4. <?php
  5. extension_loaded('imap') or die('skip imap extension not available in this build');
  6. ?>
  7. --FILE--
  8. <?php
  9. /* Prototype : string imap_8bit ( string $string )
  10. * Description: Convert an 8bit string to a quoted-printable string.
  11. * Source code: ext/imap/php_imap.c
  12. */
  13. echo "*** Testing imap_8bit() : basic functionality ***\n";
  14. var_dump(imap_8bit("String with CRLF at end \r\n"));
  15. //NB this appears to be a bug in cclient; a space at end of string should be encoded as =20
  16. var_dump(imap_8bit("String with space at end "));
  17. var_dump(imap_8bit("String with tabs \t\t in middle"));
  18. var_dump(imap_8bit("String with tab at end \t"));
  19. var_dump(imap_8bit("\x00\x01\x02\x03\x04\xfe\xff\x0a\x0d"));
  20. ?>
  21. ===Done===
  22. --EXPECT--
  23. *** Testing imap_8bit() : basic functionality ***
  24. string(28) "String with CRLF at end=20
  25. "
  26. string(25) "String with space at end "
  27. string(33) "String with tabs =09=09 in middle"
  28. string(26) "String with tab at end =09"
  29. string(27) "=00=01=02=03=04=FE=FF=0A=0D"
  30. ===Done===