RE: [Zope] encoding strings for CGI
There's no reason for Zope not to URL encode slashes (in my experience URL encoders usually encode everything but a-zA-Z0-9; has URL encoding ever been standarized, anyway?), although I'm not sure if this omission causes trouble for browsers. Exactly how have you been bitten? -- Alexander Staubo http://www.mop.no/~alex/ "What the hell, he thought, you're only young once, and threw himself out of the window. That would at least keep the element of surprise on his side." --Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
-----Original Message----- From: anthony@nextTelecom.com [mailto:anthony@nextTelecom.com]On Behalf Of Anthony Baxter Sent: 14. juni 1999 04:28 To: Alexander Staubo Cc: zope@zope.org Subject: Re: [Zope] encoding strings for CGI
Alexander Staubo wrote Simple. To URL encode "foo", just do:
<!--#var foo url_quote-->
Note that this won't quote the / character, though - I'm not sure what the best way to handle that is (yes, it's something that's bitten me before).
Anthony.
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(For developer-specific issues, use the companion list, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Alexander Staubo writes:
There's no reason for Zope not to URL encode slashes (in my experience URL encoders usually encode everything but a-zA-Z0-9; has URL encoding ever been standarized, anyway?), although I'm not sure if this omission causes trouble for browsers. Exactly how have you been bitten?
Check out RFC 2396 entitled 'Uniform Resource Identifiers (URI): Generic Syntax' for URL encoding in all its glory. Tim.
-- Alexander Staubo http://www.mop.no/~alex/ "What the hell, he thought, you're only young once, and threw himself out of the window. That would at least keep the element of surprise on his side." --Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
-- Tim Potter, System Admin/Programmer, Head Bee Guy Advanced Computational Systems CRC, RSISE Bldg Australian National University, Canberra 0200, AUSTRALIA Ph: +61 2 62798813 Fax: +61 2 62798602
Alexander Staubo wrote There's no reason for Zope not to URL encode slashes (in my experience URL encoders usually encode everything but a-zA-Z0-9; has URL encoding ever been standarized, anyway?), although I'm not sure if this omission causes trouble for browsers. Exactly how have you been bitten?
The python urllib.urlquote function can optionally encode slashes. When invoked by the Zope url_quote format it does not. The application that caused me pain was in the dataminer - you can specify constraints based on a value of a column. In the case of a date, column, for instance, specifying a date greater than 1999/06/01 would result in a URL like .../opgt1999/06/01/... - this is obviously broken. Anthony
participants (3)
-
Alexander Staubo -
Anthony Baxter -
Tim Potter