wardk has asked for the wisdom of the Perl Monks concerning the following question:
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:
and this code:/cgi-bin/sidtest?sid=%32%2D%9F%A5%54%12%23%AA%C8%C7%CF%CE%8E%AC
I am getting this:#!/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;
note that if I execute from the command line, I am seeing similar behavior: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
Any thoughts/clues are most welcome, especially if I am just being a dumbass and not seeing the obvious.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:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI param character strangeness
by count0 (Friar) on Feb 26, 2002 at 17:01 UTC | |
|
Re: CGI param character strangeness
by wardk (Deacon) on Feb 26, 2002 at 17:09 UTC |