🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.lisp
Article #48

Re: on cl-json and slashes

#48
From: Anton Antimo
Date: Tue, 17 Nov 2026 12:32
25 lines
2045 bytes
Kaz Kylheku <046-301-5902@kylheku.com> writes:

> 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

Interesting.  So the JSON spec was particularly thinking of HTML at its
beginning?  I never thought of JSON as too intimate of HTML, but perhaps
it was meant for the web specifically.  Thanks for the info.
Technical Details
Message-ID: <87mrr7ljt8.fsf@safunu.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <87jymcbkom.fsf@safunu.org> <20261116165945.535@kylheku.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!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: Re: on cl-json and slashes
Date: Tue, 17 Nov 2026 09:32:51 -0300
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <87mrr7ljt8.fsf@safunu.org>
References: <87jymcbkom.fsf@safunu.org> <20261116165945.535@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Tue, 17 Nov 2026 13:00:07 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="465013"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19LP+5IJFNTMj8/OmXzNyZeHSqGB28bULg="; posting-host="db8f451c0649bd8304488a523ff1be18"
Cancel-Lock: sha1:M4Y+DscNep3lgYAENJeWG/bP7AQ=
	sha1:0Gh0XuC+CJxfSudL1mLApvm9boU= sha256:pY5ZHZJERF7ro/2d0Fz0VI+UVqbwQujgHrDBB25fwsE=
	sha1:HF8MTTLYOmt7NdAZuAQacBr8qc0= sha256:QjqWsvwl7Ud49c6BEUk1n7lvtzgy0sFfqcircfAY23k=