[z3-five] SOLVED Re: UTF-8, Zope 2.9.x and MSIE

Roman Susi rnd at onego.ru
Thu Jul 20 13:49:06 CEST 2006


hI!

It seems, this small piece of code solves the problem (of course, it
does mean that  webapp doesn use anything except for utf8, which is my
case):

from Products.Five.form import EditView as EV, AddView as AV

class EditView(EV):
    charsets = ("utf-8",)

    def _setPageEncoding(self):
        self.request.RESPONSE.setHeader(
            'Content-Type', 'text/html; charset=utf-8')

class AddView(AV):
    charsets = ("utf-8",)

    def _setPageEncoding(self):
        self.request.RESPONSE.setHeader(
            'Content-Type', 'text/html; charset=utf-8')


Then every part of a project should import these mended view-classes and
not those from Five.


Thank you for hints which came in privite email!


Regards,
Roman

Roman Susi wrote:
> Hi,
> 
> I have a problem using Zope 2.9.x
> Products.Five.form ... EditView, AddView
> 
> - scandinavian letters (e.g. ä, ö) are erroneously stored in the object
> as a byte representation of utf-8 instead of correct text. And this
> happens only when browsing with MSIE. Also, there is no such problem
> when handling forms without any fancy EditView, AddView (just in a
> method), form enctype doesn't matter.
> 
> Thanks!
> 
> Regards,
> Roman


More information about the z3-five mailing list