real fix bug in #'decode-escaped-encoding
authorMoskvitin Andrey <archimag@gmail.com>
Tue, 23 Mar 2010 21:13:25 +0000 (00:13 +0300)
committerMoskvitin Andrey <archimag@gmail.com>
Tue, 23 Mar 2010 21:13:25 +0000 (00:13 +0300)
src.lisp

index ba471ca..3fc5c70 100644 (file)
--- 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)