mb_decode_mimeheader_variation3.phpt 888 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Test mb_decode_mimeheader() function : variation
  3. --SKIPIF--
  4. <?php
  5. extension_loaded('mbstring') or die('skip');
  6. function_exists('mb_decode_mimeheader') or die("skip mb_decode_mimeheader() is not available in this build");
  7. ?>
  8. --FILE--
  9. <?php
  10. /* Prototype : string mb_decode_mimeheader(string string)
  11. * Description: Decodes the MIME "encoded-word" in the string
  12. * Source code: ext/mbstring/mbstring.c
  13. * Alias to functions:
  14. */
  15. echo "*** Testing mb_decode_mimeheader() : variation ***\n";
  16. mb_internal_encoding('iso-8859-7');
  17. //greek in UTF-8 to be converted to iso-8859-7
  18. $encoded_word = "=?UTF-8?B?zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Dz4TPhc+Gz4fPiM+J?=";
  19. var_dump(bin2hex(mb_decode_mimeheader($encoded_word)));
  20. ?>
  21. ===DONE===
  22. --EXPECT--
  23. *** Testing mb_decode_mimeheader() : variation ***
  24. string(48) "e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f3f4f5f6f7f8f9"
  25. ===DONE===