[Zope-dev] ZPublisher: using zope.formlib and z3c.form in Zope 2

yuppie y.2011 at wcm-solutions.de
Wed Mar 2 06:29:49 EST 2011


Laurence Rowe wrote:
> On 2 March 2011 10:00, yuppie<y.2011 at wcm-solutions.de>  wrote:
>> Martin Aspeli wrote:
>>> I don't know what setPageEncoding() does, though.
>>
>> It sets a response Content-Type header with the first charset
>> processInputs tries for decoding.
>
> Is the charset of the request necessarily the right choice for the
> response? In Plone we always serve UTF-8 encoded.

getPreferredCharsets()[0] always returns 'utf-8' **if** UTF-8 is accepted.

If 'utf-8' is not in getPreferredCharsets(), it is not very likely that 
the browser speaks UTF-8 and processInputs will not even try to decode 
with UTF-8. In that case it might be better to respond with an accepted 
encoding.

Cheers, Yuppie


More information about the Zope-Dev mailing list