the CGI::charset() is useful when I use escapeHTML() to escape form values,

in CGI.pm :
####################
sub escapeHTML {
...
...
         my $latin = uc $self->{'.charset'} eq 'ISO-8859-1' ||
                     uc $self->{'.charset'} eq 'WINDOWS-1252';
         if ($latin) {  # bug in some browsers
                $toencode =~ s{'}{'}gso;
                $toencode =~ s{\x8b}{‹}gso;
                $toencode =~ s{\x9b}{›}gso;
                if (defined $newlinestoo && $newlinestoo) {
                     $toencode =~ s{\012}{
}gso;
                     $toencode =~ s{\015}{
}gso;
                }
         }
####################




2008/10/22 Rhesa Rozendaal <[EMAIL PROTECTED]>:
> Silent wrote:
>>
>> when I met a bad character problem, I use this
>> $cap->query()->charset('utf-8')  in cgiapp_init()
>
> Yeah, that's also pretty much a prerequisite for outputting proper
> utf8-encoded pages. However, it only affects output AFAIK, so you need both
> pieces to this puzzle.
>
> rhesa
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>
>

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to