src/Encoder/StringEncoder.php
private function getCodePoint($bytes)
    {
        if (\strlen($bytes) === 2) {
            return ((\ord($bytes[0]) & 0b11111) << 6)
                | (\ord($bytes[1]) & 0b111111);
        }

        if (\strlen($bytes) === 3) {
            return ((\ord($bytes[0]) & 0b1111) << 12)
                | ((\ord($bytes[1]) & 0b111111) << 6)
                | (\ord($bytes[2]) & 0b111111);
        }

        return ((\ord($bytes[0]) & 0b111) << 18)
            | ((\ord($bytes[1]) & 0b111111) << 12)
            | ((\ord($bytes[2]) & 0b111111) << 6)
            | (\ord($bytes[3]) & 0b111111);
    }
private function getCodePoint($bytes)
    {
        if (\strlen($bytes) === 2) {
            return ((\ord($bytes[0]) & 0b11111) << 6)
                | (\ord($bytes[1]) & 0b111111);
        }

        if (\strlen($bytes) === 3) {
            return ((\ord($bytes[0]) & 0b1111) << 12)
                | ((\ord($bytes[1]) & 0b111111) << 6)
                | (\ord($bytes[2]) & 0b111111);
        }

        return ((\ord($bytes[0]) & 0b111) << 18)
            | ((\ord($bytes[1]) & 0b111111) << 12)
            | ((\ord($bytes[2]) & 0b111111) << 6)
            | (\ord($bytes[3]) & 0b111111);
    }
private function getCodePoint ( $ bytes ) { if ( \ strlen ( $ bytes ) === 2 ) { return ( ( \ ord ( $ bytes [ 0 ] ) & 0b11111 ) << 6 ) | ( \ ord ( $ bytes [ 1 ] ) & 0b111111 ) ; } if ( \ strlen ( $ bytes ) === 3 ) { return ( ( \ ord ( $ bytes [ 0 ] ) & 0b1111 ) << 12 ) | ( ( \ ord ( $ bytes [ 1 ] ) & 0b111111 ) << 6 ) | ( \ ord ( $ bytes [ 2 ] ) & 0b111111 ) ; } return ( ( \ ord ( $ bytes [ 0 ] ) & 0b111 ) << 18 ) | ( ( \ ord ( $ bytes [ 1 ] ) & 0b111111 ) << 12 ) | ( ( \ ord ( $ bytes [ 2 ] ) & 0b111111 ) << 6 ) | ( \ ord ( $ bytes [ 3 ] ) & 0b111111 ) ; }
Returns the unicode code point for the given multibyte UTF-8 character.
@param string $bytes The multibyte character
@return int The code point for the multibyte character
Returns the unicode code point for the given multibyte UTF - 8 character .