[Zope-CMF] Charsets

Charlie Clark charlie at begeistert.org
Wed Jan 21 03:39:26 EST 2009

Am 21.01.2009 um 00:11 schrieb Daniel Nouri:

> Is this thread by any chance related to this bug:
> https://bugs.launchpad.net/zope2/+bug/160968
>  The IUserPreferredCharsets implementation of Zope 3 found in
>  zope.publisher.http.HTTPCharsets has the following condition in it
>  to check if the HTTP_ACCEPT_CHARSET header is available:
>      header_present = 'HTTP_ACCEPT_CHARSET' in self.request
>  However, with Zope 2's request will return '' (the empty string) for
>  any header that starts with 'HTTP_', see
>  ZPublisher.HTTPRequest.HTTPRequest.get.
>  Ultimately, this results in the HTTPCharsets.getPreferredCharsets to
>  return ['iso-8859-1'], where it should really return 'UTF-8'.
>  To understand this problem better, look at
>  Products.Five.browser.decode.processInputs, which uses the
>  negotiator to find out which charset to use to convert form
>  variables. For browsers that do not send the 'HTTP_ACCEPT_CHARSET'
>  header, this will result in wrongly encoded form values. To
>  reproduce this, fill in Chinese characters to any Five formlib form
>  with Internet Explorer 6.0. Since Firefox sends HTTP_ACCEPT_CHARSET,
>  it's not a problem there.

Yes Daniel,

this is exactly the problem we're facing. So we need to fix Zope >=  
2.10 and then we shouldn't have to worry about doing anything to the  

Charlie Clark
Helmholtzstr. 20
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226

More information about the Zope-CMF mailing list