From: Moskvitin Andrey Date: Tue, 23 Mar 2010 21:13:25 +0000 (+0300) Subject: real fix bug in #'decode-escaped-encoding X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=b879078d965c657eab92a016cc931bbc99ce234a;hp=a271a51355dee9dee25210677f9ef43533550951;p=puri-unicode.git real fix bug in #'decode-escaped-encoding --- 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)