[rt-users] Perl 5.6.1 and Encode::compat problems

Paolo Campanella paolo at mighty.co.za
Mon May 19 19:19:06 EDT 2003


Hi all

If you're a Perl 5.6.1 user, you might have noticed that pages which
take query parameters with multiple values bomb out. For instance:
http://your.rt.site/Search/Listing.html?ValueOfStatus=open&ValueOfStatus=new&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=3&RowsPerPage=50&NewSearch=1

(in this case, you are given no search results, and the page displays
a search term for Status of e.g. "Status = ARRAY(0xa97db3c)".

A quick fix, in the top-level autohandler, is to replace this:
$ARGS{$_} = Encode::decode_utf8($ARGS{$_}) foreach (keys %ARGS);

with something like this:
foreach (keys %ARGS) {
	if (ref $ARGS{$_} eq 'ARRAY') {
		for my $i (0..$#{$ARGS{$_}}) {
			$ARGS{$_}->[$i] = Encode::decode_utf8($ARGS{$_}->[$i]);
		}
	}
	else {
		$ARGS{$_} = Encode::decode_utf8($ARGS{$_});
	}
}

I presume therefore that Perl > 5.6.1's Encode::decode_utf8() deals
properly with listrefs - does anyone know if this is true? Or does
rt exhibit this problem on greater Perl versions than mine as well?


Bye

Paolo






More information about the rt-users mailing list