public static function getChar(string $text, int $offset): array
    {
        if ($text == '') {
            return [
                'letter' => '',
                'length' => 0,
            ];
        }

        $char   = substr($text, $offset, 1);
        $length = 1;
        if ((ord($char) & 0xE0) == 0xC0) {
            $length = 2;
        }
        if ((ord($char) & 0xF0) == 0xE0) {
            $length = 3;
        }
        if ((ord($char) & 0xF8) == 0xF0) {
            $length = 4;
        }
        $letter = substr($text, $offset, $length);

        return [
            'letter' => $letter,
            'length' => $length,
        ];
    }