def utf8.emit
gralha-http-core@0.1.0.0 · http.bend:95
import gralha-http-core@0.1.0.0/http.bend as Http
import Base
95def utf8.emit(+b: U32, +need: U32, +code: U32, +acc: String) -> String:
96 when(String, U32.is_eq(need, 0),
97 _ => when(String, U32.is_lt(b, 128), _ => SCon{Chr{b}, acc},
98 _ => when(String, U32.is_ge(b, 192), _ => acc, _ => SCon{Chr{65533}, acc})),
99 _ => when(String, U32.is_eq((b .&. 192 : U32), 128),
100 _ => when(String, U32.is_eq(need, 1), _ => SCon{Chr{utf8.code(b, need, code)}, acc}, _ => acc),
101 _ => SCon{Chr{65533}, acc}))