[Zope] Charset HTTP header switched to UTF-8. Bug or feature ?

Gilles Lenfant gilles at pilotsystems.net
Wed Aug 27 19:01:45 EDT 2003


Hi,

There's a strange thing in a iso-8859-1 (natural) charset site Zope 2.6.1
powered...

A form is summitted (POST) to a TTW python script.
At the end of the script, after form validation ...

<sample>
return context.sometemplate(param1=value1, ...)
</sample>

The "sometemplate" is published with this HTTP header :

Content-Type: text/html;charset=UTF-8

When nowhere in my scripts/templates, I stated to use that charset.
You can imagine the ugly things that are displayed :-/

I found a workaround: forcing the HTTP header of the response...

<sample>
REQUEST.RESPONSE.setHeader('Content-Type', 'text/html; charset=iso-8859-1')

return context.sometemplate(param1=value1, ...)
</sample>

Is this behavior a bug or a feature ?

Note that with older versions of Zope (2.3.3) I didn't need to force the
charset header like this.

Thanks in advance

--Gilles





More information about the Zope mailing list