[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/utilitymodule/ Fixed utility module to work well with any type of utility name.

Bjorn Tillenius bjoti777 at student.liu.se
Sat Oct 29 14:06:50 EDT 2005


On Sat, Oct 29, 2005 at 11:52:54AM -0400, Stephan Richter wrote:
> On Saturday 29 October 2005 11:39, Bjorn Tillenius wrote:
> > Can you give an example of a browser that does this? I'd like to try it
> > out for myself, to see what's wrong. If this indeed is the case, it's a
> > major browser bug, and should be fixed.
> 
> Konqueror.
> 
> > BTW, urllib.quote_plus() should be used only for quoting strings that
> > are to be included in the query part of the URL, not in the path part.
> 
> Yeah, but quote(), as Tarek pointed out, does not encode all characters as 
> required in this case.

It does if you pass safe=''. (Seems that in general browsers don't care
if '/' is encoded or not, though.)


> > > > I haven't looked into the problem you're trying to solve, though, so
> > > > maybe I'm missing something. Just wanted to raise a possible issue. And
> > > > I dislike cryptic URLs. ;)
> > >
> > > I hate them too! Very much! If I can get a better solution, please let me
> > > know. Basically, I have random unicode strings and need to make a
> > > URL-safe representation.
> >
> > The standard way is to encode the string using utf-8, and then url quote
> > it. If that doesn't work in some browser, I think those browsers should
> > be fixed. All names in Zope3 are by default allowed to be practically
> > any unicode string and can appear in a URL, so this problem isn't local
> > to apidoc's utility module.
> 
> Theoretically this sounds nice, but doe not hold in reality. Konqui is 
> important to *me*, so only solutions that are working with this browser are 
> acceptable to me.

I agree, we should try to be compatible with as many browsers as
possible. Also, it seems like Opera and Firefox have the same behaviour.
It seems, though, that the only thing that they decode is '%2F', which
is '/', so maybe we shouldn't allow names to contain '/'? Then again,
maybe it's the application developer's responsibility to make sure that
the names are usable in his application.

Regards,

Bjorn


More information about the Zope3-Checkins mailing list