def _get_utf8_length(first_byte_value):
    """
    Given the byte value of a UTF-8 letter, returns the length of the UTF-8 character.
    """
    if first_byte_value & 0xE0 == 0xC0:
        return 2
    if first_byte_value & 0xF0 == 0xE0:
        return 3
    if first_byte_value & 0xF8 == 0xF0:
        return 4
    # Shouldn't happen
    return 1