Re: ZPublisher: using zope.formlib and z3c.form in Zope 2

yuppie <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Hi Charlie!


Charlie Clark wrote:
> Am 02.03.2011, 12:29 Uhr, schrieb yuppie<[email protected]>:
>
>> 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.
>
> I think you are drawing the wrong conclusion

I did talk about getPreferredCharsets(), not about the Accept-Charset 
header.

> some browsers (Internet
> Explorer and Safari spring to mind but this will also be the behaviour in
> Opera from 11.10) simply don't have an accept-charset header and the W3C
> says this means you can throw anything at them, in which case UTF-8 is a
> good choice.

You implemented this in getPreferredCharsets(), so that method says 
UTF-8 is accepted if no Accept-Charset header is set.

And Five always used this line which has the same effect::

     charsets = envadapter.getPreferredCharsets() or ['utf-8']


Cheers,

	Yuppie
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.