Variable *OK-SET* The list of characters which don't need to be escaped when writing URIs.
Function ESCAPE-AS-URI Escapes all non alphanumeric characters in STRING following the URI convention.
This so blatently wrong its not even funny, and while this is exactly what I need I would do well to start using a "real" html escaping library (there are a couple to choose from).
(define-condition html-escape-error (error) ((what :accessor html-escape-error.what :initarg :what)))
(define-condition unterminated-html-entity (html-escape-error) ())
(define-condition unknown-html-entity (html-escape-error) ())
(define-condition unknown-char-escape (warning) ((what :accessor html-escape-error.what :initarg :what)))