[Catalyst] Patch for Catalyst::Plugin::Unicode::Encoding

Bill Moseley moseley at hank.org
Tue Mar 18 05:24:56 GMT 2008


The plugin decodes all parameters using:

    $_ = $c->encoding->decode( $_, $CHECK ) for ( ref($value) ? @{$value} : $value );


I'd think it would be wise to check to see if the string is already
decoded:

    for ( ref($value) ? @{$value} : $value ) {
        next if Encode::is_utf8($_);
        $_ = $c->encoding->decode( $_, $CHECK );
    }

See any reason not to do that?

-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list