Well, JSON should be encoded in unicode (either UTF-8, UTF-16 or UTF-32,
with UTF-8 as the default), so the clients shouldn't be having a problem if
their JSON parsers are correct.
However, you may want to try the :escape-non-ascii option that Cheshire and
Ring-JSON have. e.g.
(wrap-json-resp
Thanks, James.
To clarify, Compojure has no problems serving the JSON content. But the
SBCL common lisp app and a third-party app (Klipfolio) both are choking on
the output. I was able to fix the SBCL app by telling Babel to use latin-1
encoding, but I need another solution for the output to
Yes, you can return a full response map with the desired encoding:
(GET "/" []
{:status 200
:headers {"Content-Type" "text/html; charset=ISO-8859-1"}
:body "Hello World"})
Or use the ring.util.response namespace:
(GET "/" []
(-> (resp/response "Hello World")
(resp/c