def utf8.step.if
import bend-kit-encoding@0.5.0.0/encoding.bend as Encodingimport Base
116def utf8.step.if(+need: U32, +lo: U32, +hi: U32, cp: U32, +b: U32, out: String, idle: Bool) -> Utf8:
117 match idle:
118 case True{}:
119 utf8.lead(b, out, U32.is_lt(b, 128))
120 case False{}:
121 utf8.cont.in(need, cp, b, out, Bool.and(U32.is_le(lo, b), U32.is_le(b, hi)))