def byte_count
import bolt@1.27.0.0/src/lsp/frame.bend as Frameimport Base
204# how many UTF-8 bytes the chars take, counted on from ds
205def byte_count(cs: List<&2, Char>, ds: List<&2, Digit>) -> List<&2, Digit>:
206 match cs:
207 case Nil{}:
208 ds
209 case Con{c, t}:
210 byte_count(t, tick.by(width(Char.to_u32(c)), ds))