sukria/Dancer — pull request #726 by skington (2012-01-13 00:19:49+00:00)
Title: Don't tell JSON to encode JSON as utf8; Dancer will do that.

Follow-up to my previous commit about UTF8-encoding and JSON.

Basically, Dancer will attempt to encode anything other than a forwarded request, so JSON shouldn't be told to encode anything it spits out; encoding into UTF8 twice isn't particularly pretty.

Talking of pretty, this isn't, particularly; I particularly dislike the hack of checking caller(). The other approach I considered was messing about with Dancer::Response->{encoded} but the serializer doesn't have access to that object, and nor should it.