;; Shameless edit of ##sys#char->utf8-string (define (char->utf8-length c) (let ([i (char->integer c)]) (cond ((<= i #x7F) 1) ((<= i #x7FF) 2) ((<= i #xFFFF) 3) ((<= i #x1FFFFF) 4) (else (error "UTF-8 codepoint out of range:" i)))))