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

WG: Escaping the '!' character

Sun Biao
June 6, 2003 00:40
WG: Escaping the '!' character
Message ID:

-----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.

-----Urspr√ľngliche Nachricht-----
Von: Jim Vaught []
Gesendet: Mittwoch, 4. Juni 2003 18:32
An: ''
Betreff: Escaping the '!' character


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/ 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About