logoalt Hacker News

pmarreck • today at 12:53 AM • 1 reply • view on HN

> JSON is much easier to directly access and manipulate in JS compared to XML

and yet a single newline in a text field will shatter its validity or force you to enter escaping-hell.

(I tamed that entire general problem by making https://github.com/pmarreck/printable_binary, and it will permit you to pack all binary data into a string, without any escaping issues, while retaining ascii legibility, although that requires a decoding step.)


Replies

Joker_vD • today at 1:04 AM

> and yet a single newline in a text field will shatter its validity or force you to enter escaping-hell.

So would a single & or > in the body of an XML element, you know.