src/Peach/DF/Utf8Codec.php
private function getCharCount($unicode)
    {
        static $borders = array(
            1 => 0x80,       //  7 bit
            2 => 0x800,      // 11 bit
            3 => 0x10000,    // 16 bit
            4 => 0x200000,   // 21 bit
        );
        foreach ($borders as $i => $border) {
            if ($unicode < $border) {
                return $i;
            }
        }
        // @codeCoverageIgnoreStart
        throw new Exception("Illegal state");
        // @codeCoverageIgnoreEnd
    }
private function getCharCount($unicode)
    {
        static $borders = array(
            1 => 0x80,       //  7 bit
            2 => 0x800,      // 11 bit
            3 => 0x10000,    // 16 bit
            4 => 0x200000,   // 21 bit
        );
        foreach ($borders as $i => $border) {
            if ($unicode < $border) {
                return $i;
            }
        }
        // @codeCoverageIgnoreStart
        throw new Exception("Illegal state");
        // @codeCoverageIgnoreEnd
    }
指定された Unicode 符号点が UTF-8 において何バイトで表現されるか調べます.
@param  int $unicode Unicode 符号点
@return int バイト数