This function take one byte, set the first two bits to 10, and returns one byte of the continuation part.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int8), | intent(in) | :: | byte |
pure function set_continuation_byte(byte) result(res) use, intrinsic :: iso_fortran_env, only: int8 implicit none integer(int8), intent(in) :: byte integer(int8) :: res res = ibset(byte, 7) ! 1xxxxxxx res = ibclr(res, 6) ! 10xxxxxx end function set_continuation_byte