File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / iconv / tests / iconv002.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:56 2012 UTC (12 years, 8 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--TEST--
iconv() test 2 (UCS4BE to ASCII)
--SKIPIF--
<?php
include('skipif.inc');
if (@iconv("ascii","UCS-4LE", "abcd") == '') {
	die("skip conversion to UCS-4LE not supported"); 
}
?>
--INI--
error_reporting=2039
--FILE--
<?php
/* include('test.inc'); */
/*
Expected output:
&#97;&#98;&#99;&#100;
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";
?>
--EXPECT--
&#97;&#98;&#99;&#100;
abcd

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>