Annotation of embedaddon/php/ext/mbstring/tests/bug49528.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #49528 (UTF-16 strings prefixed by BOM wrongly converted)
! 3: --SKIPIF--
! 4: <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
! 5: --FILE--
! 6: <?php
! 7: var_dump(bin2hex(mb_convert_encoding("\xff\xfe\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
! 8: var_dump(bin2hex(mb_convert_encoding("\xfe\xff\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
! 9: var_dump(bin2hex(mb_convert_encoding("\xff\xfe\xff\xfe\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
! 10: var_dump(bin2hex(mb_convert_encoding("\xff\xfe\xfe\xff\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
! 11: var_dump(bin2hex(mb_convert_encoding("\xfe\xff\xff\xfe\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
! 12: var_dump(bin2hex(mb_convert_encoding("\xfe\xff\xfe\xff\x01\x02\x03\x04", "UCS-2BE", "UTF-16")));
! 13: ?>
! 14: --EXPECT--
! 15: string(8) "02010403"
! 16: string(8) "01020304"
! 17: string(12) "feff02010403"
! 18: string(12) "fffe02010403"
! 19: string(12) "fffe01020304"
! 20: string(12) "feff01020304"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>