[Zope] problem with input elements and unicode/utf-8

Daryl Daly daryld at norco.com
Tue Feb 20 19:14:06 EST 2007


I have setup a test case which seems to show the problem. This test
removes the database component.

New install of zope 2.10.2:
Zope Version (Zope 2.10.2-final, python 2.4.4, linux2)
Python Version 2.4.4 (#1, Oct 23 2006, 13:58:00) [GCC 4.1.1 20061011 (Red
Hat 4.1.1-30)]
System Platform linux2

I created a page template which contains:
<html tal:define="dummy python:request.RESPONSE.setHeader('Content-Type',
'text/html;; charset=utf-8');" >
  <head>
    <title tal:content="template/title">The title</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
  </head>
  <body tal:define="test_str python:u'This is a test \u00e9 \u00ae \u2022
\u2024 \u2219 \u03b2'.encode('utf-8')">
    <span tal:content="test_str"></span>
    <form>
      <input name="t1" value=""
             tal:attributes="value test_str">
    </form>
  </body>
</html>

When this page is viewed in Firefox (v 1.5.0.9), it shows the characters
correctly. When viewed in IE6, the non-ascii characters show as garbage.

If I add this to the zope.conf:
<cgi-environment>
  HTTP_ACCEPT_CHARSET utf-8
</cgi-environment>

the non-ascii characters show correctly in IE6 (except one of them shows
as a box - there is no 'garbage')

Is this zope.conf setup required for IE6 or am I doing something wrong?

Thanks,
Daryl.



More information about the Zope mailing list