Frame.encode.char: def of bolt@1.27.0.0 Import: import bolt@1.27.0.0/src/lsp/frame.bend as Frame Lines 68-79 of bolt@1.27.0.0/src/lsp/frame.bend: https://jend.leeeet.dev/read.txt?path=bolt@1.27.0.0/src/lsp/frame.bend&start_line=68&end_line=79 import Base # a code point's bytes, by its width, in front of the rest def encode.char(ww: U32, +xx: U32, rest: List<&2, U32>) -> List<&2, U32>: match ww: case 1: xx <> rest case 2: (192 .|. (xx >> 6n) : U32) <> (128 .|. (xx .&. 63) : U32) <> rest case 3: (224 .|. (xx >> 12n) : U32) <> (128 .|. ((xx >> 6n) .&. 63) : U32) <> (128 .|. (xx .&. 63) : U32) <> rest case other: (240 .|. (xx >> 18n) : U32) <> (128 .|. ((xx >> 12n) .&. 63) : U32) <> (128 .|. ((xx >> 6n) .&. 63) : U32) <> (128 .|. (xx .&. 63) : U32) <> rest Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Con https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Word.Nil