[Zope3-dev] Unicode problems

Stephan Richter stephan.richter at tufts.edu
Mon May 31 08:45:54 EDT 2004


On Saturday 29 May 2004 13:53, Bjorn Tillenius wrote:
> Right now, PATH_INFO is unquoted, even though HTTPRequest assumes it is.
> But the real problem is that PATH_INFO is encoded with utf-8. Wouldn't it
> be better to store it as a unicode string?
>
> One problem with PATH_INFO being utf-8 is that the error service breaks
> with unicode urls.

I think this is a valid bug and should be fixed.

> As I see it, HTTPRequestParser should unquote the path and store it as
> a unicode string, and HTTPRequest shouldn't try to unquote and decode
> it. That would solve the problem, but will it break anything? I'm not
> quite sure if something relies on stuff in zope.server being a specific
> encoding.

The question to ask is where the conversion is supposed to be located. Until 
now, we have always kept the conversion to and from unicode in IRequest and 
IResponse. However, if you have good reasons to make an exception for the 
PATH_INFO, then go ahead and fix the problem. Make sure you document and test 
everything well.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training



More information about the Zope3-dev mailing list