GnuDeveloper.com

PHP6 with unicode

There are 2 steps for Configure PHP 6
1. you have Configure and Installing ICU (International Components for Unicode)
2. After step1 only you can Configure PHP 6

Steps for Configure and Installing ICU (International Components for Unicode)

wget ftp://ftp.software.ibm.com/software/glo ... _6-src.tgz
mkdir /usr/local/lib/icu-3_6
tar -xvf icu*
cd icu/source
./configure --prefix=/usr/local/lib/icu-3_6
make && make install

Configure PHP 6
if u already installed by rpm, .debian package then give that corresponding ICU path. now assume /usr/local/lib/icu-3_6 as follows

./configure --with-icu-dir=/usr/local/lib/icu-3_6
make
make install

Test Code of PHP 6 for testing Unicode

Code:
<?
//UTF-16 => 2 Byte => we can easily represent by universal character names(\u).
// \u for the escape sequence requires exactly 4 hexadecimal digits
$vEnglishAlphabetStr = "\u0061\u0062\u0063\u0064";
foreach (new TextIterator($vEnglishAlphabetStr, TextIterator::CHARACTER) as $vChar) {
var_dump($vChar);
}
?>
Output:
unicode(1) "a"
unicode(1) "b"
unicode(1) "c"
unicode(1) "d"

Groups: