boofulls
asked on
char codes passed using querystring
in my script in get values that are passed to it by using this code
if ($ENV{'REQUEST_METHOD'} eq POST)
{
$DataLength=$ENV{'CONTENT_ LENGTH'};
read (STDIN, $QueryString, $DataLength);
}
else
{
$QueryString = $ENV{'QUERY_STRING'};
}
#Splitting the pairs and putting them in a list
@NameValuePairs = split (/&/, $QueryString);
the problem is that i want to send
french characters in the querystring
these characters look all funny when print them.....
for instance if i have a capital A with a little line over it starting from bottom right and going to the top left (ascii code #192) and i try to print it after it is put into querystring i get
%C0
how can i be sure that the codes will remain unaffected?
if ($ENV{'REQUEST_METHOD'} eq POST)
{
$DataLength=$ENV{'CONTENT_
read (STDIN, $QueryString, $DataLength);
}
else
{
$QueryString = $ENV{'QUERY_STRING'};
}
#Splitting the pairs and putting them in a list
@NameValuePairs = split (/&/, $QueryString);
the problem is that i want to send
french characters in the querystring
these characters look all funny when print them.....
for instance if i have a capital A with a little line over it starting from bottom right and going to the top left (ascii code #192) and i try to print it after it is put into querystring i get
%C0
how can i be sure that the codes will remain unaffected?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
malec's answer was easier to use....
$str = uri_unescape($safe);
where $safe is the escaped string.
URI is a perl module which can be downloaded from CPAN:
http://search.cpan.org/