Hello Jonathan and all others,
Need help with Mason2 utf8 components.
In HTML::Mason I'm using the following plugin. In the Mason2 I can't
figure out what method I should modify.
Could you help me how to rewrite this Html::Mason plugin into Mason2?
Need convert every params (get/post) into ut8.
Thank you in advance, really need help with this.
ak
use base qw(HTML::Mason::Plugin);
use warnings;
use strict;
use utf8;
sub start_request_hook {
my ( $self, $context ) = @_;
my $args_ref = $context->args();
foreach my $arg ( @{$args_ref} ) {
if( ref($arg) eq "ARRAY" ) {
my $max = scalar(@{$arg}) - 1;
for(my $i = 0; $i<=$max; $i++){
utf8::is_utf8($arg->[$i]) ||
utf8::decode($arg->[$i]);
}
} else {
utf8::is_utf8($arg) || utf8::decode($arg);
}
}
return;
}
------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network
management toolset available today. Delivers lowest initial
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users