2002-02-03 10:18:30 +08:00
|
|
|
--TEST--
|
2002-11-07 00:58:08 +08:00
|
|
|
iconv() test 2 (UCS4BE to ASCII)
|
2002-02-03 10:18:30 +08:00
|
|
|
--SKIPIF--
|
2002-11-07 00:37:10 +08:00
|
|
|
<?php
|
2005-10-25 22:22:56 +08:00
|
|
|
include('skipif.inc');
|
2002-11-07 00:37:10 +08:00
|
|
|
if (@iconv("ascii","UCS-4LE", "abcd") == '') {
|
|
|
|
die("skip conversion to UCS-4LE not supported");
|
|
|
|
}
|
|
|
|
?>
|
2002-10-29 01:15:21 +08:00
|
|
|
--INI--
|
|
|
|
error_reporting=2039
|
2002-02-03 10:18:30 +08:00
|
|
|
--FILE--
|
2002-10-29 01:15:21 +08:00
|
|
|
<?php
|
2002-10-30 00:28:12 +08:00
|
|
|
/* include('test.inc'); */
|
2002-10-29 01:15:21 +08:00
|
|
|
/*
|
|
|
|
Expected output:
|
|
|
|
abcd
|
|
|
|
abcd
|
|
|
|
*/
|
|
|
|
|
|
|
|
$s = unpack("V*", iconv("ascii","UCS-4LE", "abcd"));
|
|
|
|
foreach($s as $c) { print "&#$c;"; } print "\n";
|
|
|
|
|
|
|
|
$s = pack("NNNN", 97, 98, 99, 100);
|
|
|
|
$q = iconv("UCS-4BE", "ascii", $s);
|
|
|
|
print $q; print "\n";
|
|
|
|
?>
|
2002-02-03 10:18:30 +08:00
|
|
|
--EXPECT--
|
|
|
|
abcd
|
|
|
|
abcd
|