Article View: comp.lang.lisp
Article #45Re: on cl-json and slashes
From: Kaz Kylheku
Date: Tue, 17 Nov 2026 01:03
Date: Tue, 17 Nov 2026 01:03
24 lines
1856 bytes
1856 bytes
On 2026-11-16, Anton Antimo <anton@safunu.org> wrote: > 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? It allows JSON to be embedded into HTML. Consider JSON which looks like this: [ "</script>" ] // oops: false positive for end of script marker. [ "<\/script>" ] // no problem -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca
Technical Details
Message-ID:
<20261116165945.535@kylheku.com>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-mailReferences:
<87jymcbkom.fsf@safunu.org>Show 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: Kaz Kylheku <046-301-5902@kylheku.com> Newsgroups: comp.lang.lisp Subject: Re: on cl-json and slashes Date: Tue, 17 Nov 2026 01:03:30 -0000 (UTC) Organization: A noiseless patient Spider Lines: 24 Message-ID: <20261116165945.535@kylheku.com> References: <87jymcbkom.fsf@safunu.org> Injection-Date: Tue, 17 Nov 2026 01:03:32 +0000 (UTC) Injection-Info: dont-email.me; logging-data="52694"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lDnZad80NAyRezAAPlWuFvqOCPBSaL1Y="; posting-host="2ea98194fc4e1764e93d015a3b02c220" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:QXQlnUgraiuD2NAU1jY0aEOLiWI= sha256:FpDWVegAlYbAWp3vENpa88v2ECwPryXnrv5aAh5r53k= sha1:tXjk9C5R1LyJ63/7LMwaYNmy73I= sha256:VqXH+hRV94pHJV7tOl993X1u9Hb6RL+61yDQYgBVPdI=