On 18 Jul 2006, at 23:30, gabor wrote:
> 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? The environment stuff is all taken from the CGI specification. The original CGI specification makes no mention of character encoding at all: http://hoohoo.ncsa.uiuc.edu/cgi/interface.html An attempt was made in 1999 to update the spec to the status of an RFC. A draft was prepared but expired at the end of that year without being accepted as a formal RFC - so it doesn't have any real standing. It did however specify ASCII as the encoding for use in the CGI protocol: http://cgi-spec.golux.com/draft-coar-cgi-v11-03-clean.html In the absence of anything better than that, I think it's safe to assume that CGI environment variables should always be ASCII encoded. I think that request.META should contain unicode strings based on the principle of least surprise - if everything else is unicode, it should be too. So we assume ASCII as the encoding for that stuff and turn it in to unicode strings. 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 -~----------~----~----~----~------~----~------~--~---