[Bese-devel] qescape
Aleksandar Bakic
a_bakic at yahoo.com
Fri Dec 2 19:23:43 UTC 2005
Hi,
I noticed that I needed a function that escapes single and double quotes in
cdata-based attributes. I could not find one with this functionality in
arnesi/ucw/... sources after a brief look. So, here is one:
(defun qescape (str)
;(declare (optimize (speed 3)))
;(declare ((or null simple-string) str))
(with-output-to-string (escaped)
(loop for c across str do
(case c
(#\' (princ "'" escaped))
(#\" (princ """ escaped))
(t (write-char c escaped))))))
Alex
__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
More information about the bese-devel
mailing list