2006/8/31, Andreas Jung <<a href="mailto:lists@zopyx.com">lists@zopyx.com</a>>:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br>--On 31. August 2006 19:28:54 +0200 Dieter Maurer <<a href="mailto:dieter@handshake.de">dieter@handshake.de</a>><br>wrote:<br><br>> Luiz Fernando Bernardes Ribeiro wrote at 2006-8-30 14:08 -0300:<br>>> 2006/8/29, Andreas Jung <
<a href="mailto:lists@zopyx.com">lists@zopyx.com</a>>:<br>>> ...<br>>> After trying a lot of things, I found the problem is really in the<br>>> zpublisher realm, no matter what kind of encoding trick I use, even with
<br>>> a python script, the output is converted to the default encoding if I<br>>> use any variable or dynamic value from the database.<br>><br>> If you were right (which I still hope you won't) than someone
<br>> severely misunderstood the meaning of "default".<br>><br><br>I think he is not right.<br><br>-aj<br><br></blockquote></div><br>Zope did respect the default setting when I changed the charset header in the file.
<br>
<br>
The lesson learned is: Working with
two encoding charsets is very trick, and even trickier if you use
the ZMI to edit files. <br><br>I had to create a simple ZPT file with the initial XML block
and "inject" the rest of the xml data, including variables and database, using a tal:content pointing
to a python script encoding everything to utf-8. The ZPT file was
needed as simple way to change the charset header trough the ZMI.<br><br>When you change the charset trough the ZMI Zope trows an exception if it find any non-conforming character, the problem is that since the default charset is set to iso Zope reencodes my file to iso when it generates the editing form field so when I submit it back Zope raises an exception.
<br>
<br>Considering I can't change everything to utf-8 I
will have to live with it and maybe find a simpler pattern to change the charset without raising an exception (maybe the dummy tal:define?).<br><br>I hope it help others.<br>
<br>
Thanks for your help and time,<br>
<br>-- <br>Luiz Fernando B. Ribeiro