[Haskell-cafe] UTF-8 problems when decoding JSON data coming from Network.HTTP

Mark Lentczner markl at glyphic.com
Sun Oct 17 11:21:00 EDT 2010

On Oct 17, 2010, at 5:37 AM, Michael Snoyman <michael at snoyman.com> wrote:
> in the case of JSON, I believe this is always specified as UTF-8.

RFC 4627 section 3 says that JSON must be encoded in Unicode, but all encodings are acceptable. The encoding is inferred by the firsthand four octets. So you need to be prepared to decode UTF-16 and UTF-32 and endian variants.

- Mark

More information about the Haskell-Cafe mailing list