On Sun, Mar 10, 2013 at 2:06 PM, Peter Flanigan <p...@roxsoft.co.uk> wrote:


>    # Only touch 'text-like' contents
>      return $c->next::method(@_)
>         unless $c->response->content_type =~ /^text|xml$|javascript$/;
>
> smells bad, it will apply to text/x-json but not application/json
>

The code that I use only encodes if the utf8 flag is set.   The JSON
encoders (at least what I use) encode to utf8, so my code doesn't touch
JSON as it's already been encoded.

I decode all input -- database, templates, text files, web requests and API
requests.   All data that represents characters must be decoded on input.


-- 
Bill Moseley
mose...@hank.org
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to