[Zope] strange unicode behaviour

Hugo Filipe Ramos Hugo Filipe Ramos" <ml@zopers.org
Thu, 24 Jul 2003 00:25:03 +0100


What about using this line inside your <head> block?
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

and setting it to your zone encoding?


Regards

HR



----- Original Message ----- 
From: "Giuseppe Bonelli" <giuseppe.bonelli@tiscalinet.it>
To: <zope@zope.org>
Sent: Thursday, July 24, 2003 12:17 AM
Subject: [Zope] strange unicode behaviour


> I have spent the last 30 minutes going crazy with this:
> 
> in dtml:
> <html>
> <head>
> <meta http-equiv="content-type" content="text/html;charset=utf-8">
> </head>
> <dtml-call "getText()")>
> </html>
> 
> in python:
> def getText():
>     s=u'a string with some accented chars'
>     s=s.encode('utf-8')
>     return s
> 
> the above works fine, but
> return s.lower()
> 
> does not !!! (the accented chars are badly rendered in the browser).
> 
> Can someone, please, explain this to me??
> 
> I am on zope 2.6.1 (installed from binaries under win),
> 
> From the python console everithing is OK, so there should be something
> with Zope.
> I have utf-8 as sys.defaultencoding and I do not load any locale when
> starting Zope.
> 
> Thanks for any help,
> 
> --peppo
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@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 )