emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Re: [PATCH] Implement fast verisons of json-parse funct


From: Drew Adams
Subject: RE: [External] : Re: [PATCH] Implement fast verisons of json-parse functions
Date: Sat, 30 Mar 2024 23:28:59 +0000

> Drew Adams writes:
> 
> >> >> 2. Handling of a single \0 byte
> >> >
> >> > Does JSON allow null bytes in its strings?
> >
> > Strict JSON doesn't allow null characters (U+0000).
> > But does this parser only support strict JSON?
> 
> This parser only accepts JSONs which are according to the spec (in
> theory).  But this is not different from the libjansson based
> parser in this regard.  That also doesn't allow null characters in
> JSON.

It might be good if in the future there were
_also_ a way to parse lax (real-world) JSON data.

Not that strict JSON isn't real-world.  It's just
that there's also lots of real-world JSON data
that's not strict.  And yes, there are parsers
that handle it.

> Just to be sure that we're on the same page: this means that the
> parser doesn't support actual null bytes in the stream.  But if a
> user wants to put a U+0000 character in a string, they can do that
> by using "\u0000".

Yes, we're on the same page.  I meant _unescaped_
NUL (^@, U+0000, \0) chars - I shoulda said that.

Often a lax parser treats all ASCII control chars,
including U+0000, as insignificant whitespace.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]