[cgiapp] UTF-8 output

Emmanuel Seyman emmanuel.seyman at club-internet.fr
Mon Nov 2 10:21:40 EST 2009


* Michael Lackhoff [02/11/2009 09:25] :
>
> I am using CAP::Dispatch and the TT-plugin. Without the header_add I get
> a HTTP header with an ISO-8859-1 charset definition so the browser

I believe you're seeing this because CGI::App use the CGI module,
which defaults to ISO-8859-1 as a charset.

>From CGI.pm :

    # set charset to the safe ISO-8859-1
    $self->charset('ISO-8859-1');

http://cpansearch.perl.org/src/LDS/CGI.pm-3.48/lib/CGI.pm

I always add the following line :

$webapp->header_add(-charset => 'UTF-8');

to my CGI::App .cgi files to make this go away.

Emmanuel



More information about the cgiapp mailing list