Article View: comp.lang.lisp
Article #43on cl-json and slashes
From: Anton Antimo
Date: Mon, 16 Nov 2026 20:11
Date: Mon, 16 Nov 2026 20:11
18 lines
1716 bytes
1716 bytes
It seems cl-json is automatically escaping slashes when I invoke
encode-json-to-string. I located the question
https://stackoverflow.com/questions/60103909
that explains that the JSON spec mandates the escaping of slashes, but
doesn't really explain why, although it says there's not quite a
practical need for that.
Do you know why the escaping of slashes was considered in the first place?
My solution has been to follow the suggestion in the answer (to the
question 60109909). So I wrote:
(defun json-response (data)
(let ((cl-json::+json-lisp-escaped-chars+
(remove #\/ cl-json::+json-lisp-escaped-chars+ :key #'car)))
(cl-json:encode-json-to-string data)))
Technical Details
Message-ID:
<87jymcbkom.fsf@safunu.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Anton Antimo <anton@safunu.org> Newsgroups: comp.lang.lisp Subject: on cl-json and slashes Date: Mon, 16 Nov 2026 17:11:53 -0300 Organization: A noiseless patient Spider Lines: 18 Message-ID: <87jymcbkom.fsf@safunu.org> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 16 Nov 2026 21:00:10 +0000 (UTC) Injection-Info: dont-email.me; logging-data="4106011"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193teE7sZqRqk9BZaJvv3b6xFKB6m/7fMk="; posting-host="544f3a698d56c6a49a394aa8f5da69a6" Cancel-Lock: sha1:hTKqxwkwStZbtV46NuLlfN5vWGM= sha1:DSgqN4886Gy+CPvp1Z3abcpspzU= sha256:kyOiaB1ntwq2wZiQvWgorp51pVjpSxWN5BKbOxFmbes= sha1:DLQJynR5h4xMPJf+xVSl5OFwqIs= sha256:opo3T5tZGgUi5nyu0X6gjSGPXhDjh033e5MhCFibdIw=