News for hackers. Stuff that matters.
Re:Parsing JSON Is a Minefield (2016) by magicalhippo on Monday October 11, 2021 @10:51AM (#28828962)
> My general opinion is that it's extremely hard to reliably use JSON as an interchange format reliably when multiple systems and/or parser implementations are involved.

XML is very precisely defined in comparison to JSON. Yet we've had one customer who had a system that couldn't handle XML files with newlines in them at all, and several which sometimes sends ISO 8859-1 (Latin 1) encoded data in some fields of a XML file with encoding="UTF-8" in the header...

We of course also have some nice fixed-field integrations, based on customer's specs, where the system suddenly sends multiple mangled characters if any non-ASCII character is present, causing the fields to suddenly not be so fixed anymore... It behaves very much like UTF-8 interpreted as Latin-1, except with something else than Latin-1.

Anyway, I've given up trying to be strict at this point. We will have to wash incoming data, it's apparently inevitable.

Re:Parsing JSON Is a Minefield (2016) by spookthesunset on Monday October 11, 2021 @03:14PM (#28831860)
I mean even if it is well defined that doesn’t mean the devs are using the languages native parser library. I’ve encounter at least two projects where the devs rolled their own XML “parser” using regex and “substring” functions. Why? “The xml library was too bloated… much easier to write it ourself”. Suffice to say, they had tons to problems.