{"action":"created","issue":{"url":"https://api.github.com/repos/json-api/json-api/issues/889","labels_url":"https://api.github.com/repos/json-api/json-api/issues/889/labels{/name}","comments_url":"https://api.github.com/repos/json-api/json-api/issues/889/comments","events_url":"https://api.github.com/repos/json-api/json-api/issues/889/events","html_url":"https://github.com/json-api/json-api/issues/889","id":107373677,"number":889,"title":"Is there a a specified encoding that should be used with `application/vnd.api+json` responses?","user":{"login":"fake-name","id":1401239,"avatar_url":"https://avatars.githubusercontent.com/u/1401239?v=3","gravatar_id":"","url":"https://api.github.com/users/fake-name","html_url":"https://github.com/fake-name","followers_url":"https://api.github.com/users/fake-name/followers","following_url":"https://api.github.com/users/fake-name/following{/other_user}","gists_url":"https://api.github.com/users/fake-name/gists{/gist_id}","starred_url":"https://api.github.com/users/fake-name/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fake-name/subscriptions","organizations_url":"https://api.github.com/users/fake-name/orgs","repos_url":"https://api.github.com/users/fake-name/repos","events_url":"https://api.github.com/users/fake-name/events{/privacy}","received_events_url":"https://api.github.com/users/fake-name/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-20T05:20:18Z","updated_at":"2015-09-20T08:15:41Z","closed_at":"2015-09-20T08:15:41Z","body":"I'm working with a web-service that implements a JSON-API, and there is no definitive encoding that is specified for the API responses, and the server doesn't return a content-disposition header with the encoding.\r\n\r\nRealistically, I'm pretty sure the server here is responding in UTF-8, but the JSON spec allows UTF-8, UTF-16 or UTF-32 ([ref](https://tools.ietf.org/html/rfc7159#section-8.1)), so it's ambiguous.\r\n\r\nIt'd be nice to have the standard either require a proper content-disposition header, or specify a encoding that must be used in the absence of any other response metadata.\r\n\r\nIs this within the scope of the JSON-API specification? I'm not sure.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/json-api/json-api/issues/comments/141757722","html_url":"https://github.com/json-api/json-api/issues/889#issuecomment-141757722","issue_url":"https://api.github.com/repos/json-api/json-api/issues/889","id":141757722,"user":{"login":"ethanresnick","id":471894,"avatar_url":"https://avatars.githubusercontent.com/u/471894?v=3","gravatar_id":"","url":"https://api.github.com/users/ethanresnick","html_url":"https://github.com/ethanresnick","followers_url":"https://api.github.com/users/ethanresnick/followers","following_url":"https://api.github.com/users/ethanresnick/following{/other_user}","gists_url":"https://api.github.com/users/ethanresnick/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanresnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanresnick/subscriptions","organizations_url":"https://api.github.com/users/ethanresnick/orgs","repos_url":"https://api.github.com/users/ethanresnick/repos","events_url":"https://api.github.com/users/ethanresnick/events{/privacy}","received_events_url":"https://api.github.com/users/ethanresnick/received_events","type":"User","site_admin":false},"created_at":"2015-09-20T08:15:41Z","updated_at":"2015-09-20T08:15:41Z","body":"Basically, the various JSON specifications have never defined a way to provide information about the particular unicode encoding in use because this can be detected reliably by the client. This JSON specification offers [instructions](http://tools.ietf.org/html/rfc4627#section-3) for doing so, assuming the sender properly leaves out the byte order mark. (You'll need to use more complicated logic if you want to handle the case that the BOM is, improperly, included.)\r\n\r\nAlternatively, you could just use a JSON parser that handles this all for you :)"}}