On 19 Jul 2006, at 13:19, Ivan Sagalaev wrote:

> Talking about QUERY_STRING... While the string itself is in ASCII  
> it has
> urlencoded data and there the encoding matters. As fas as I can see in
> practice browsers tend to encode those data in the same encoding as  
> the
> page from where those links come. So for decoding urlencoded
> QUERY_STRING I think it's reasonable to use DEFAULT_CHARSET.

We shouldn't be decoding QUERY_STRING in request.META at all - we  
should leave it as urlencoded ASCII. request.META is meant to give  
you access to the 'raw data' from the browser.

We do however need to take charset stuff in to account when creating  
the request.GET and request.POST arrays - that's where the query  
string should be parsed and unencoded and turned in to a set of name/ 
value unicode strings. The character encoding used for this data  
should be specified in a browser header; as a general rule, browsers  
submit data back to the server using the same character encoding that  
the page with the form on was sent as.

Cheers,

Simon

--~--~---------~--~----~------------~-------~--~----~
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