JSONFeed
JSONFeed copied to clipboard
Allow only UTF-8 encoding
JSON Feeds should be encoded using UTF-8 — but any encoding that’s legal JSON is legal for JSON Feeds.
Please only allow UTF-8.
- The web platform is trying to converge on UTF-8. UTF-16 is being removed wherever possible, and is not supported in new web features.
- UTF-32 is utterly useless for file interchange.
- Support for multiple encodings is a headache for clients.
- Other encodings have to be detected and converted
- UTF-16/32 are endian-dependent and are not ASCII superset
- UTF-16 is a pain to work with due to surrogate pairs and environments that confuse UCS-2 and UTF-16.
- Majority of libraries produce UTF-8 (or JS-escaped ASCII), so UTF-16/32 is going to be rare in practice and probably unsupported/broken in most clients anyway
The web platform is trying to converge on UTF-8. UTF-16 is being removed wherever possible, and is not supported in new web features.
The JSON mode of XMLHttpRequest is UTF-8-only, so going UTF-8-only would make all JSON Feeds consumable by XHR.
See also RFC 7493.