[Zope-dev] UnicodeDecodeError from PageTemplate rendering after upgrading to Zope 2.12.7

Chris Withers chris at simplistix.co.uk
Wed Sep 1 08:09:38 EDT 2010


Marius Gedminas wrote:
>> Has anyone seen this or anything similar before?
> 
> Yes.  Basically, every Zope site I've upgraded to 2.12 has suffered from
> this.  Annoyingly this only happens with MSIE, so developers/admins tend
> not to notice.

...well, and Safari, but no-one uses that, right? ;-)

> Clarifying the "only with MSIE" comment: this happens if and only if
> the HTTP request doesn't explicitly include 'UTF-8' in Accept-Charset.
> IIRC.

OK, but I'll ask this again; what has the present of an Accept-Charset 
header got to do with whether or not rending a page template to a 
unicode string succeeds? Surely, up to that point, it really shouldn't 
matter what the browser wants or doesn't want, we're just getting a 
unicode string ready from whatever data we have around, right?

>> Any solutions spring to mind?
> 
> Magically sprinkle .encode() / .decode() in TAL expressions/Python
> scripts, where appropriate.

I want to get to the bottom of why the Accept-Charset header is getting 
involved at this point. Anyone able to point me at the code that does this?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list