Subclass CGI (and create TT plugin wrapper for the subclass) to get utf8 params
[evergreen-equinox.git] / Open-ILS / src / perlmods / lib / OpenILS / WWW / CGIUTF8.pm
1 package OpenILS::WWW::CGIUTF8;
2 use strict;
3 use warnings;
4 use base qw(CGI);
5 use Encode;
6
7 sub param {
8     my ($self, $k) = @_;
9
10     return map { Encode::decode_utf8($_) } CGI::param($k) if wantarray;
11     return Encode::decode_utf8(CGI::param($k));
12 }
13
14 sub param_bin {
15     my $self = shift;
16
17     return CGI::param(@_);
18 }
19
20 1;