def utf8.width

gralha-http-core@0.1.0.0 · http.bend:55

import gralha-http-core@0.1.0.0/http.bend as Http
import Base

55def utf8.width(+c: U32) -> U32:
56  when(U32, U32.is_lt(c, 128), _ => 1, _ => when(U32, U32.is_lt(c, 2048), _ => 2,
57    _ => when(U32, U32.is_lt(c, 65536), _ => 3, _ => 4)))

Uses (3)

Used by (1)