anchor.diff:                 (parse ()
                    (let ((next-char (read-next-char nil)))
                      (case next-char
  -                         (#\% (char%))
  -                         (#\+ (char+))
  -                         (t (write-next-char next-char)))
  +                     (#\% (char%))
  +                     ;;(#\+ (char+)) TODO what was this? delme eventually...
  +                     (t (write-next-byte (char-code next-char))))
                      (parse)))
                  (char% ()
                    (let* ((restart-input-index input-index)
  -                        (restart-output-index output-index)
                           (next-char (read-next-char t)))
                      (restart-case
  -                       (write-next-char (code-char (case next-char
  -                                                     (#\u (+ (ash (char-to-int (read-next-char t)) 12)
  -                                                             (ash (char-to-int (read-next-char t)) 8)
  -                                                             (ash (char-to-int (read-next-char t)) 4)
  -                                                             (char-to-int (read-next-char t))))
  -                                                     (t (+ (ash (char-to-int next-char) 4)
  -                                                           (char-to-int (read-next-char t)))))))
  -                     (continue-as-is ()
  -                       :report "Continue reading uri without attempting to convert the escaped-code to a char."
  -                       (setf input-index restart-input-index
  -                             output-index restart-output-index)
  -                       (write-next-char #\%)))))
  -               (char+ ()
  -                 (write-next-char #\space)))
  +                    (write-next-byte (+ (ash (char-to-int next-char) 4)
  +                                        (char-to-int (read-next-char t))))
  +                    (continue-as-is ()
  +                                    :report "Continue reading uri without attempting to convert the escaped-code to a char."
  +                                    (setf input-index restart-input-index)
  +                                    (write-next-byte #.(char-code #\%)))))
  +                 (values))
  +               ;; TODO what was this? delme eventually...
  +               #+nil(char+ ()
  +                      (write-next-char #\space)))
           (parse)))))
  +
  +(declaim (inline unescape-as-uri))
  +(defun unescape-as-uri (string)
  +  (%unescape-as-uri string))
  +
  +(declaim (inline nunescape-as-uri))
  +(defun nunescape-as-uri (string)
  +  (%unescape-as-uri string))
  +
  +
   
   ;;;; ** HTML
   
  
positive.code:   (loop
        ;; The list of characters which don't need to be escaped when writing URIs.
        for ok-char across "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.," do
        (setf (aref *uri-escaping-ok-table* (char-code ok-char)) t)))
  
  (defun escape-as-uri (string)
    "Escapes all non alphanumeric characters in STRING following
  
negative.code:            (type stream stream)
             (optimize (speed 3) (debug 0)))
    (loop
        for char-code :of-type (unsigned-byte 8) :across (the (vector (unsigned-byte 8))
                                                           (string-to-octets string :utf-8)) do
        (if (aref (the (simple-array boolean (256)) (load-time-value *uri-escaping-ok-table* t)) char-code)
            (write-char (code-char char-code) stream)
            (format stream "%~2,'0X" char-code))))
  
  (define-condition uri-parse-error (error)
    ((what :initarg :what :reader uri-parse-error.what)))
  