Link to home
Start Free TrialLog in
Avatar of boofulls
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?
Avatar of shlomoy
shlomoy

use URI::Escape;
$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/
ASKER CERTIFIED SOLUTION
Avatar of malec
malec

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of boofulls

ASKER

malec's answer was easier to use....