On Sat, 2006-04-01 at 09:06 +0400, Ivan Sagalaev wrote:
> Thanks for the reply, Malcolm!
> 
> Malcolm Tredinnick wrote:
> 
> >A relatively minor point: I would prefer to leave something like this
> >method in place, since otherwise everybody has to implement it
> >themselves if they care about HTTP compliance. The problem is the
> >Accept-Charset header in the HTTP request (ยง14.2 of RFC 2616). If the
> >client does not accept UTF-8 as the response encoding, you have to
> >convert it to something they can accept.
> >
> Then you should know from what you are converting. We don't require 
> users to create HttpResponse with unicode. And if you have a byte string 
> you have no way to know how exactly it is encoded and no way to convert 
> it in an arbitrary encoding.

That's a valid point. I had forgotten we don't know the client's
encoding at this layer.

Your other arguments about poorly behaving clients are unconvincing,
since those clients are just simply broken and will remain so, whilst we
should support correctly behaving clients as well. But your argument
above is puts things into focus: the client has to examine the headers
and act appropriately; it cannot be pushed up to a HttpResponse-derived
class at all.

[...]
> >>- HttpResponse.write raises an exception when HttpResponse was created 
> >>with an iterator and not a string. If it's a string it appends to it.
> >>    
> >>
> >I don't understand why this is necessary (raising the exception). What
> >problem do you see here?
> >  
> >
> How do you append content to an iterator? It's not necessarily even a 
> file-like object.

My mistake. I managed to get the use of write() twisted around in my
head. Your logic looks correct.

So it looks like I actually have no comments that make sense any
longer. :-)

Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to