Encoding.utf8.lead.multi: def of bend-kit-encoding@0.5.0.0 Import: import bend-kit-encoding@0.5.0.0/encoding.bend as Encoding Lines 80-84 of bend-kit-encoding@0.5.0.0/encoding.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-encoding@0.5.0.0/encoding.bend&start_line=80&end_line=84 import Base def utf8.lead.multi(+b: U32, out: String) -> Utf8: +need = Bool.pick(U32, U32.is_lt(b, 224), 1, Bool.pick(U32, U32.is_lt(b, 240), 2, 3)) +lo = Bool.pick(U32, U32.is_eq(b, 224), 160, Bool.pick(U32, U32.is_eq(b, 240), 144, 128)) +hi = Bool.pick(U32, U32.is_eq(b, 237), 159, Bool.pick(U32, U32.is_eq(b, 244), 143, 191)) Utf8{need, lo, hi, U32.and(b, U32.shrn(63, U32.to_nat(need))), out} Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-kit-encoding@0.5.0.0/encoding.bend&name=Utf8