notice that by default - C::V::JSON will detect utf8 "perl flagged" scalars
and automatically output the utf8 header. I've ran into issues where I was
pulling in file system data via YAML, which was *not* utf8 by default, and
ultimately caused my issue with utf8 display to an extjs javascript panel.

hope this helps.
-nw

On Mon, Jul 26, 2010 at 8:36 AM, Larry Leszczynski <[email protected]>wrote:

> Hi Dave -
>
> > After searching google, and reading through all of the relevant
> > documentation, and a considerable portion of the code, we have been
> > unable to locate the correct place to set or override the Content-Type
> > header to append a "charset=utf-8" string, required by our caching proxy
> > to properly handle the encoding.  We would like a place to handle all
> > mimetypes, so that our JSON, JSONP, and XML interfaces all get the
> > correct charset set.
>
> If you're sure all your content actually is utf-8, one way is to
> subclass Catalyst::View and do something like:
>
> after process => sub {
>
>    my ($self, $c) = @_;
>
>    my $ct = $c->response->content_type;
>
>    if ($ct)
>    {
>        $ct =~ s/;\s*charset=.*//i;
>        $ct .= '; charset=utf-8';
>    }
>    else
>    {
>        $ct = 'text/html; charset=utf-8';
>    }
>
>    $c->response->content_type($ct);
> };
>
>
> Thanks!
> Larry
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to