def utf8.encode.go

mylsm-lsm-store@0.6.0.1 · src/StorageBytes.bend:178

import mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend as StorageBytes
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

178def utf8.encode.go(text: String, cursor: Bytes.Cursor) -> Bytes.Cursor:
179  match text:
180    case SNil{}:
181      cursor
182    case SCon{Chr{+scalar}, tail}:
183      utf8.encode.go(tail, utf8.put.scalar(cursor, scalar,
184        U32.is_le(scalar, 127), U32.is_le(scalar, 2047), U32.is_le(scalar, 65535)))

Uses (5)

Used by (1)