Annotation of embedaddon/php/ext/iconv/tests/iconv_stream_filter_delimiter.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: iconv stream filter
! 3: --SKIPIF--
! 4: <?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?>
! 5: --INI--
! 6: iconv.internal_charset=iso-8859-1
! 7: --FILE--
! 8: <?php
! 9: $fp = fopen(dirname(__FILE__).'/iconv_stream_filter.txt', 'rb');
! 10: var_dump(bin2hex(fread($fp, 10)));
! 11: var_dump(bin2hex(fread($fp, 5)));
! 12: var_dump(bin2hex(fread($fp, 1)));
! 13: fclose($fp);
! 14:
! 15: $fp = fopen(dirname(__FILE__).'/iconv_stream_filter.txt', 'rb');
! 16: stream_filter_append($fp, 'convert.iconv.ISO-2022-JP/EUC-JP');
! 17: var_dump(bin2hex(fread($fp, 10)));
! 18: var_dump(bin2hex(fread($fp, 5)));
! 19: var_dump(bin2hex(fread($fp, 1)));
! 20: fclose($fp);
! 21:
! 22: $fp = fopen(dirname(__FILE__).'/iconv_stream_filter.txt', 'rb');
! 23: stream_filter_append($fp, 'convert.iconv.ISO-2022-JP.EUC-JP');
! 24: var_dump(bin2hex(fread($fp, 10)));
! 25: var_dump(bin2hex(fread($fp, 5)));
! 26: var_dump(bin2hex(fread($fp, 1)));
! 27: fclose($fp);
! 28:
! 29: $fp = fopen(dirname(__FILE__).'/iconv_stream_filter.txt', 'rb');
! 30: stream_filter_append($fp, 'convert.iconv.ISO-2022-JP\0EUC-JP');
! 31: var_dump(bin2hex(fread($fp, 10)));
! 32: var_dump(bin2hex(fread($fp, 5)));
! 33: var_dump(bin2hex(fread($fp, 1)));
! 34: fclose($fp);
! 35: ?>
! 36: --EXPECTF--
! 37: string(20) "1b244224332473244b24"
! 38: string(10) "41244f1b28"
! 39: string(2) "42"
! 40: string(20) "a4b3a4f3a4cba4c1a4cf"
! 41: string(10) "69636f6e76"
! 42: string(2) "0a"
! 43: string(20) "a4b3a4f3a4cba4c1a4cf"
! 44: string(10) "69636f6e76"
! 45: string(2) "0a"
! 46:
! 47: Warning: stream_filter_append(): unable to create or locate filter "convert.iconv.ISO-2022-JP\0EUC-JP" in %siconv_stream_filter_delimiter.php on line %d
! 48: string(20) "1b244224332473244b24"
! 49: string(10) "41244f1b28"
! 50: string(2) "42"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>