src/CFPropertyList/CFBinaryPropertyList.php
protected static function binaryStrlen($val)
    {
        for ($i=0; $i<strlen($val); ++$i) {
            if (ord($val{$i}) >= 128) {
                $val = self::convertCharset($val, 'UTF-8', 'UTF-16BE');
                return strlen($val);
            }
        }

        return strlen($val);
    }
protected static function binaryStrlen($val)
    {
        for ($i=0; $i<strlen($val); ++$i) {
            if (ord($val{$i}) >= 128) {
                $val = self::convertCharset($val, 'UTF-8', 'UTF-16BE');
                return strlen($val);
            }
        }

        return strlen($val);
    }
protected static function binaryStrlen ( $ val ) { for ( $ i = 0 ; $ i < strlen ( $ val ) ; ++ $ i ) { if ( ord ( $ val { $ i } ) >= 128 ) { $ val = self :: convertCharset ( $ val , 'UTF-8' , 'UTF-16BE' ) ; return strlen ( $ val ) ; } } return strlen ( $ val ) ; }
Counts the number of bytes the string will have when coded; utf-16be if non-ascii characters are present.
@param string $val The string value
@return integer The length of the coded string in bytes
Counts the number of bytes the string will have when coded ; utf - 16be if non - ascii characters are present .