[Zope] Character set problems
Niklas Saers
niklassaers at gmail.com
Fri Sep 16 15:34:56 EDT 2005
Dear Dragos and everyone,
I have the problem narrowed down to the Apache/Zope connection. I've more or
less decided I want to stick with ISO-8859-1 because moving everything to
UTF-8 didn't really help me out. All in ISO-8859-1 works fine with Zope
stand-alone, but unfortunately Apache needs to bridge it. As of right now,
running it through the Apache bridge gives me the following:
HTTP/1.1 200 OK
Date: Fri, 16 Sep 2005 19:38:27 GMT
Server: Zope/(Zope 2.7.4-0, python 2.3.5, freebsd5) ZServer/1.1
Content-Type: text/html;charset=utf-8
Transfer-Encoding: chunked
whereas doing it through Zope gives me the following header:
HTTP/1.1 200 OK
Server: Zope/(Zope 2.7.4-0, python 2.3.5, freebsd5) ZServer/1.1
Date: Fri, 16 Sep 2005 19:32:33 GMT
Content-Length: 3941
Content-Type: text/html; charset=iso-8859-1
I'm a little bit confused as to why Apache changes the character-set and
encoding. My Apache setup for the virual host is this:
<VirtualHost *:80>
ServerAdmin me at mysite.dk
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
DocumentRoot /home/mysite
ServerName www.mysite.dk <http://www.mysite.dk>
ServerAlias mysite.dk <http://mysite.dk>
ErrorLog /var/log/www.mysite.dk-error_log
CustomLog /var/log/www.mysite.dk-access_log common
## proxy_html_module conf
ProxyHTMLURLMap http://localhost:8080 http://www.mysite.dk
SetOutputFilter proxy-html
RequestHeader unset Accept-Enconding
AddDefaultCharset ISO-8859-1
CharsetDefault ISO-8859-1
</VirtualHost>
What am I missing that makes the encoding go UTF-8? Not that it matters, but
the HTML also contains
<META HTTPD_EQUIV="Content-Type" CONTENT="text/html;charset=iso-8859-1" />
Thanks for all your help so far
Cheers
Nik
On 9/9/05, Dragos Chirila <d.chirila at finsiel.ro> wrote:
>
> Hi
>
> Here are some things you can do to handle your problem. For me, this
> approach worked just fine.
>
> 1. Your HTML pages must have set the encoding to utf-8. Put this in the
> HEAD tag of your html pages:
>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>
> 2. For the Root folder add a property named 'management_page_charset' of
> type 'string' with the value 'utf-8'. In this way the ZMI pages will be
> displayed with utf-8 encoding.
>
> 3. Modify your HTML code like this:
>
> <input name="test:utf8:ustring" />
>
> If 'test' is also a property of some object, make sure it has 'ustring'
> type.
>
>
> After that the value will be displayed correctly in all pages.
>
> Note: If your Zope runs over an Apache you must check also the Apache
> settings (to serve pages utf-8 encoded)
>
> Hope this will help.
>
> Regards,
> Dragos
>
>
> Niklas Saers wrote:
> > Hey guys,
> > I've installed Zope on a FreeBSD server. My problem domain is very
> > small: display a list of when people are unavailable, and let people
> > update the list. This is all in Danish, and here are come my problems.
> > Danish has three extra letters not in the ASCII alfabet, three
> > upper-case and three lower-case. When getting the data from a <input
> > name="test" /> where I've written "æ ø å Æ Ø Å", I get: æ ø Ã¥ Æ Ø
> Ã…
> >
> > What is the standard way of ensuring that I get the correct data?
> >
> > I tried writing a little converter, but the string
> >
> > tekst = tekst.replace("\xc3\xa6", "ae");
> >
> > gives me the error *UnicodeDecodeError: **'ascii' codec can't decode
> > byte 0xc3 in position 0: ordinal not in range(128)*
> >
> > Do you have any suggestion on how to overcome these problems?
> >
> > Cheers
> >
> > Nik
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Zope maillist - Zope at zope.org
> > http://mail.zope.org/mailman/listinfo/zope
> > ** No cross posts or HTML encoding! **
> > (Related lists -
> > http://mail.zope.org/mailman/listinfo/zope-announce
> > http://mail.zope.org/mailman/listinfo/zope-dev )
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20050916/4b4da380/attachment.htm
More information about the Zope
mailing list