gabor wrote:

> questions:
> 1. django publishes the whole environ dictionary as request.META. the 
> environ dictionary is a normal byte-string dictionary. so, should we 
> convert it to unicode so that the request.META dictionary only contains 
> unicode strings?
> 
> 1.a: if yes, how? some things like QUERY_STRING and REQUEST_METHOD are 
> relatively simple how to convert, but what should happen to the other 
> server-related stuff like HTTP_X_FORWARDED_HOST? should we convert them? 
> if yes, with what encoding? ascii? iso-8859-1?

Given what Simon said about META deriving from CGI, I think that means 
you can treat the strings in there as 7-bit ascii, and they'll be utf8 
encoded as a side-effect. You could then sanity check all input from 
META by declaring a UTF8 encoding when passing into unicode; eg

   x = unicode(HTTP_X_FORWARDED_HOST, 'utf-8')

if that barfed something's up*.

If META was upgraded to pass out unicode objects tho', that works for me.

cheers
Bill

* possibly including my understanding given I haven't looked at the guts 
of that code.

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