def utf8.valid
import bend-kit-websocket@0.4.0.0/websocket.bend as Websocketimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
637# b back, and whether it is well-formed UTF-8.
638def utf8.valid(b: Bytes.Bytes) -> Bytes.Bytes & Bool:
639 Bytes.Bytes{+len, buf} = b
640 utf8.fin(len, utf8.go(U32.to_nat(len), Bytes.peek(buf, 0), 0, st(0, 128, 191)))