develooper Front page | perl.libwww | Postings from June 2003

WG: Escaping the '!' character

From:
Sun Biao
Date:
June 6, 2003 00:40
Subject:
WG: Escaping the '!' character
Message ID:
D7387C1AA470D51199E300508BBB415530845C@f94000r4.essen.karstadt.de


-----Urspr√ľngliche Nachricht-----
Von: Sun Biao 
Gesendet: Freitag, 6. Juni 2003 09:36
An: 'Jim Vaught'
Betreff: AW: Escaping the '!' character


If you want to know how being able to make the correct escaping of '!' I
don't know. But I had the same parse problem and converted f.e. the '%21' to
'!' in my cgi perl program and it works.
Sun

-----Urspr√ľngliche Nachricht-----
Von: Jim Vaught [mailto:JimV@mailcode.com]
Gesendet: Mittwoch, 4. Juni 2003 18:32
An: 'libwww@perl.org'
Betreff: Escaping the '!' character



Greetings.

I ran into a problem this week with the '!' character not being
escaped (the same problem mentioned in the old "Not escaping all
characters" thread).  I was trying to post form data to a cgi script.
One of the values to be sent ended with an exclamation point.  The
cgi script wasn't working for me.  I made a local copy of the form
page changing the action to a server I wrote which does nothing but log
all data sent to it.  I filled in this form in Netscape 7.0.2 and
submitted it (to the dummy server).  I then pointed my LWP script to the
dummy server instead of the real cgi script.  I noticed Netscape was
sending the '!' as '%21' whereas LWP was sending it as '!'.  I tried IE
6.0 as well, and (not surprisingly... Netscape is probably violating
the RFC in an effort to maintain compatibility with ie) it also sends
'%21' (I'll resist the urge to get on my 'calculated subversion
of industry standards' soapbox).  Just for kicks I tried Lynx
2.8.4rel.1 and it also sends '%21'.  I'm as much of a purist as
anyone, and I realize from the reference to the RFC in the previous
thread on this matter that LWP is doing the officially right thing
here and Netscape, internet explorer, and Lynx are doing the wrong
thing, but when I hacked query_form() in URI/_query.pm adding an
exclamation point to the reg-exp's which determine which chars to
escape in the key and value the cgi script I was posting to started
working.  So even though escaping '!' is not what the spec says to
do, it is what Netscape, Lynx, and ie do and it appears that there
are cases where it now needs to be done.


Jim




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About