- _input_to_hash($target, $ENV{QUERY_STRING}) if $ENV{QUERY_STRING};
- _input_to_hash($target, $ARGV[0]) if @ARGV && $ARGV[0];
+ # yes i know, copying all those values around isn't terribly efficient, but
+ # the old version of dumping everything into form and then launching a
+ # tactical recode nuke at the data is still worse.
+
+ # this way the data can at least be recoded on the fly as soon as we get to
+ # know the source encoding and only in the cases where encoding may be hidden
+ # among the payload we take the hit of copying the request around
+ my $temp_target = { };
+
+ # since both of these can potentially bring their encoding in INPUT_ENCODING
+ # they get dumped into temp_target
+ _input_to_hash($temp_target, $ENV{QUERY_STRING}) if $ENV{QUERY_STRING};
+ _input_to_hash($temp_target, $ARGV[0]) if @ARGV && $ARGV[0];