Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Output Percent Encoding

Status
Not open for further replies.

wyshmasta

Programmer
Oct 24, 2003
3
US
In the few years I have been building forms and perl scripts to parse and utilize them, I have never come accross this problem before.

When a textfield or textarea contains a quotation mark " or special character, it's encoded with percents (%22) and displayed on the page that way and shows up in the email that way.

How do I get around this?

The form input values are being parsed and placed into simple scalar variables. I then use the variables where needed to display the input.
 
use URI::Escape;

Code:
my $str = "hello world!!!";

my $uri = uri_escape ($str);
print $uri; "hello%20world%21%21%21"

print uri_unescape ($uri); "hello world!!!";

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Thanks!

I already figured out my main mistake. When parsing the input from the form.. I forgot to include the following:

Code:
/pack("C", hex($1))/eg;

I usually include it after:

Code:
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])

It was a bonehead mistake that I luckily caught late.

Thanks!

 
join the 21st century and use the CGI.pm module to parse your form input.

- Kevin, perl coder unexceptional!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top