#!/usr/bin/env php > 6) . chr(0x80 | $c & 0x3F); } elseif ($c <= 0xFFFF) { return chr(0xE0 | $c >> 12) . chr(0x80 | $c >> 6 & 0x3F) . chr(0x80 | $c & 0x3F); } elseif ($c <= 0x10FFFF) { return chr(0xF0 | $c >> 18) . chr(0x80 | $c >> 12 & 0x3F) . chr(0x80 | $c >> 6 & 0x3F) . chr(0x80 | $c & 0x3F); } else { return false; } } function unistr($c) { return implode("", array_map("unichr", array_map("hexdec", explode(" ", $c)))); } function getRow( $f ) { $row = fgets( $f ); if( $row === false ) return false; $row = rtrim($row); $pos = strpos( $row, COMMENT ); $pos2 = strpos( $row, ")" ); if( $pos === 0 ) return array($row); $c = ""; if( $pos ) { if($pos2) $c = substr( $row, $pos2 + 2 ); else $c = substr( $row, $pos ); $row = substr( $row, 0, $pos ); } $ret = array(); foreach( explode( SEPARATOR, $row ) as $ent ) { if( trim( $ent ) !== "" ) { $ret[] = unistr($ent); } } $ret[] = $c; return $ret; }