JSONFeed icon indicating copy to clipboard operation
JSONFeed copied to clipboard

Allow only UTF-8 encoding

Open kornelski opened this issue 8 years ago • 2 comments

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

kornelski avatar May 18 '17 21:05 kornelski

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.

hsivonen avatar May 19 '17 15:05 hsivonen

See also RFC 7493.

JKingweb avatar Feb 23 '18 19:02 JKingweb