Fellow Monks, I have an interesting situation with a CGI parameter.
I am somewhat convinced it's a character set issue, but not sure what the
resolution is. It appears that param is having an issue unencoding the parameter.
I can see in the raw query_string that the encoded string is passing in OK, but
when I yank that parm out via CGI->param it's getting hosed. I'd rather not
just parse the query_string myself if I don't have to.
Any thoughts on this? I am on an AIX box using Websphere.
given this URL parameter:
/cgi-bin/sidtest?sid=%32%2D%9F%A5%54%12%23%AA%C8%C7%CF%CE%8E%AC
and this code:
#!/ots/perl/bin/perl
$|++;
use strict;
use CGI;
my $q = new CGI;
my $sid = $q->param("sid");
print "Content-type: text/plain\n\n";
print "\nsid is: $sid\n";
print "\nsid escaped is: " . $q->escape($sid);
print "\nsid unescaped is: " . $q->unescape($sid);
print "\nENV{QUERY_STRING} is: " . $ENV{QUERY_STRING};
exit;
I am getting this:
sid is: 2-Ÿ¥T#ªÈÇÏÎŽ¬
sid escaped is: 2-%9F%A5T%12%23%AA%C8%C7%CF%CE%8E%AC
sid unescaped is: 2-Ÿ¥T#ªÈÇÏÎŽ¬
ENV{QUERY_STRING} is: sid=%32%2D%9F%A5%54%12%23%AA%C8%C7%CF%CE%8E%AC
note that if I execute from the command line, I am seeing similar
behavior:
gen31$ ./sidtest sid=%32%2D%9F%A5%54%12%23%AA%C8%C7%CF%CE%8E%AC
Content-type: text/plain
sid is: 2-¥T#ªÈÇÏά
sid escaped is: 2-%9F%A5T%12%23%AA%C8%C7%CF%CE%8E%AC
sid unescaped is: 2-¥T#ªÈÇÏά
ENV{QUERY_STRING} is:
Any thoughts/clues are most welcome, especially if I am just being a dumbass and
not seeing the obvious.