Cli.char_bytes: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 8016-8024 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=8016&end_line=8024 import Base # The bytes c stands for: an escape's byte for U+DC80..U+DCFF, a Unicode # scalar's UTF-8, and U+FFFD's for any other surrogate or a value past # U+10FFFF, as Bend's writer prints them. def char_bytes(c: Char) -> List<&2, U32>: match c: case Chr{+x}: code_bytes(U32.is_lt(x, 128), U32.is_lt((x - 56448 : U32), 128), Bool.and(U32.is_le(x, 1114111), U32.is_ge((x - 55296 : U32), 2048)), x) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List 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_ge https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=code_bytes