X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src.lisp;fp=src.lisp;h=3fc5c70f9fffc01230beacf06b4426e077bdf4e8;hb=b879078d965c657eab92a016cc931bbc99ce234a;hp=ba471ca7e9ae02bc3c1886f6c50e4478d6ca2989;hpb=a271a51355dee9dee25210677f9ef43533550951;p=puri-unicode.git diff --git a/src.lisp b/src.lisp index ba471ca..3fc5c70 100644 --- a/src.lisp +++ b/src.lisp @@ -845,7 +845,13 @@ URI ~s contains illegal character ~s at position ~d." (= (sbit reserved-chars octet) 0)) (write-char ch out) (incf i - (* (if (> octet 127) 2 1) + (* (cond + ((< octet #x80) 1) + ((< octet #x800) 2) + ((< octet #x10000) 3) + ((< octet #x200000) 4) + ((< octet #x4000000) 5) + (t 6)) 3))) (t (write-string (subseq string i (+ i 3)) out) (incf i 3)