def escape.scalar
import emerging-ezjson@1.3.0.0/src/print.bend as Printimport Base
44# a scalar value as escape.plain writes it; any other code point as U+FFFD,
45# as Go's encoding/json writes invalid UTF-8
46def escape.scalar(+cp: U32, ch: Char, ok: Bool) -> String:
47 match ok:
48 case True{}:
49 escape.plain(cp, ch)
50 case False{}:
51 String.from_list([Char.from_u32(65533)])