Source
(defun make-html-entities ()
(let ((ht (make-hash-table :test 'equal)))
(flet ((add-mapping (char escaped)
(setf (gethash char ht) escaped
(gethash escaped ht) char)))
(add-mapping #\< "<")
(add-mapping #\> ">")
(add-mapping #\& "&")
(add-mapping #\" """)
(add-mapping "a`" "à")
(add-mapping "a'" "á")
(add-mapping "e`" "è")
(add-mapping "e'" "é")
(add-mapping "i'" "ì")
(add-mapping "i`" "í")
(add-mapping "o`" "ò")
(add-mapping "o'" "ó")
(add-mapping "u`" "ù")
(add-mapping "u'" "ú"))
ht))
Source Context