codepoint_num_bytes Function

public pure function codepoint_num_bytes(byte) result(n)

get the number of bytes of a code point based on its first byte display: private

Arguments

TypeIntentOptionalAttributesName
integer(kind=c_int8_t), intent(in) :: byte

Return Value integer


Contents

Source Code


Source Code

    pure function codepoint_num_bytes(byte) result(n)
        integer(kind=c_int8_t), intent(in) :: byte
        integer :: n

        n = NUM_BYTES_UTF8(iand(int(byte, 4), int(z'000000FF', 4)))
        if (n == 0) n = 1

    end function codepoint_num_bytes