On 2010-2-26 18:25, Tres Seaver wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Wichert Akkerman wrote:
>> On 2/25/10 17:08 , Tres Seaver wrote:
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>> Adam GROSZER wrote:
>>>> Looks like zope.publisher burps on unicode URL which contain non-ascii
>>>> chars. This is from a KGS 3.4 application, but looking at the source
>>>> it still seems to have the same problems.
>>>> 729, in redirect
>>>> return super(BrowserResponse, self).redirect(location, status)
>>>> line 882,
>>>> in redirect
>>>> self.setHeader('Location', location)
>>>> line 676,
>>>> in setHeader
>>>> value = str(value)
>>>> UnicodeEncodeError: 'ascii' codec can't encode character u'\xd6' in
>>>> position 71: ordinal not in
>>> Two issues:
>>> - - Technically there is no such thing as a "unicode URL": URLs are
>>> always ASCII, with other characters encoded. IRIs and IRLs are
>>> a different thing altogether.
>> I see this as naming confusion. In this day and age every URL is
>> effectively an IRI, and every modern browser treats them that way. If
>> you look at http://jp.wikipedia.org/ you can see how well that works. I
>> do not see why zope.publisher should not be able to support that
>> transparently. Other systems such as Routes and repoze.bfg do.
> Browseers *display* what looks like unicode to the user, but they *pass*
> URL-encoded ASCII bytes to the server.
But why can't zope.publisher do that conversion? It don't see the point
in requiring all the thousands of routines that call those functions to
do that conversion when zope.publisher can easily do so itself.
Wichert Akkerman <wich...@wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -