3 ms·
a newline is encoded as the two characters "\n" in json and would not be confused with a literal \n (aka \x0a) character
by justinsaccount 9y ago
a newline is encoded as the two characters "\n" in json and would not be confused with a literal \n (aka \x0a) character
- dungle6 9y agoErm...JSON allows whitespace last I checked. \n (ie the actual \x0a) is a whitespace character, and so can appear as a discarded token in JSON. So you would basically have to restrict to a subset of JSON -- it's not actually JSON anymore at that point.