[Zope] Character Swapping / Mapping

Michel Pelletier michel@digicool.com
Sat, 26 Feb 2000 16:25:14 -0800


Jatwood@bwanazulia.com wrote:
> 
> I have an URL coming out of a database like "http://www.myplace.com"
> and need to pass it to another website but they want it in the format
> of  "http%3A%2F%2Fwww%2Emyplace%2Ecom". Is there a simple method to
> do this with or some sort of VAR tag? If not, what is the find and
> replace tag?

The python string module (available from DTML with _.string) has many
functions that let you do things like replace and map and translate. 
See the python docs for more info.

It looks like you want to URL quote your string.  There are standard
python methods to do that for you also.

-Michel

> 
> Thanks,
> JMA
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )