- my $cgi = shift;
- foreach my $f ($cgi->param) {
- $cgi->param($f, map { decode_utf8 $_ } $cgi->param($f));
+ # decode_form_utf8 method is needed for 5.10
+ if ($] < 5.01) {
+ my $cgi = shift;
+ foreach my $f ($cgi->param) {
+ $cgi->param($f, map { decode_utf8 $_ } $cgi->param($f));
+ }
+ }
+} #}}}
+
+sub decode_form_utf8 ($) { #{{{
+ if ($] >= 5.01) {
+ my $form = shift;
+ foreach my $f ($form->field) {
+ $form->field(name => $f,
+ value => decode_utf8($form->field($f)),
+ force => 1,
+ );
+ }