1 package OpenILS::WWW::EGWeb::CGI_utf8;
3 # The code in this module is copied from (except for a tiny modification)
4 # Template::Plugin::CGI, which is written by:
6 # Andy Wardley E<lt>abw@wardley.orgE<gt> L<http://wardley.org/>
8 # Copyright (C) 1996-2007 Andy Wardley. All Rights Reserved.
10 # This module is free software; you can redistribute it and/or
11 # modify it under the same terms as Perl itself.
15 use base 'Template::Plugin';
16 use CGI qw(:all -utf8);
24 # monkeypatch CGI::params() method to Do The Right Thing in TT land
30 return $self->{ _TT_PARAMS } ||= do {
31 # must call Vars() in a list context to receive
32 # plain list of key/vals rather than a tied hash
33 my $params = { $self->Vars() };
35 # convert any null separated values into lists
36 @$params{ keys %$params } = map {
37 /\0/ ? [ split /\0/ ] : $_