It appears that at this point, response.content is a utf8-encoded bytestring.
I'm playing with a response middleware doing something like:

MY_RE.sub(u'%s</body>' % text, response.content)

which raises a UnicodeDecodeError if response.content contains non-ascii.

I understand that the strings need to be of the same type, but was wondering
if response.content needs to be returned as a utf8-encoded bytestring or if
it's ok to convert it to unicode and return that.  Does it matter?

Gary


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to