3 ms·
- JSON just has UTF-8. XML has encoding madness. - JSON has just one escape format and all unicode codepoints can be used. XML generally allows only certain un
by legulere 5y ago
- JSON just has UTF-8. XML has encoding madness.
- JSON has just one escape format and all unicode codepoints can be used. XML generally allows only certain unicode codepoints, at some places like element names its further restricted (Quick: Which characters are not allowed? What's the difference between XML 1.0 and 1.1 here?).
XML escapes at every place differently. In comments you need to escape less than elsewhere. In attributes you can use newlines but they will get normalized to spaces, you have to hex-encode newlines. There's Cdata.
- JSON doesn't have the entity madness with potential security issues.
- JSON doesn't have namespaces that add a lot of complexity with little benefit