Http.utf8.width: def of ezhttp@0.22.0.0 Import: import ezhttp@0.22.0.0/src/http.bend as Http Lines 126-132 of ezhttp@0.22.0.0/src/http.bend: https://jend.leeeet.dev/read.txt?path=ezhttp@0.22.0.0/src/http.bend&start_line=126&end_line=132 import Base # octets one code point takes in UTF-8, for a text written onto the wire # (RFC 3629 §3). Content-Length counts octets (RFC 9110 §8.6); a Bend String # counts code points. def utf8.width(+u: U32) -> Nat: Bool.pick(Nat, U32.is_lt(u, 128), 1n, Bool.pick(Nat, U32.is_lt(u, 2048), 2n, Bool.pick(Nat, U32.is_lt(u, 65536), 3n, 4n))) Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt