Hello,<br><br>Add a file named sitecustomize.py in python_path/lib/python/site<div id="1emv" class="ArwC7c ckChnd">-packages with the following code:<br>import sys<br>sys.setdefaultencoding(&#39;UTF-8&#39;)<br><br>restart zope and it should fix your problem
<br><br>Eric<br></div><br><br><div class="gmail_quote">On Nov 9, 2007 10:59 AM, adam molyneaux &lt;<a href="mailto:adam.molyneaux@bluewin.ch">adam.molyneaux@bluewin.ch</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi<br><br>I am currently having problems sorting out utf8 encoding through the following chain of events, and I would GREATLY<br>appreciate any help anyone can offer. &nbsp;I need to do the following, in a Zope 2.9.2-, python 
2.4.3 setup (I have also<br>tried this on Zope 2.10.4 with the uniocode patch for MySQLDA and get slightly different equally annoying results).<br><br><br>1. Read and parse a file encoded as utf8 - currently done with an external script
<br>2. send it to a page to edit as utf8<br>3. save it from the page into a mysql database as utf8<br><br><br>This is slightly complicated by the fact that steps 2 and 3 need to happen via XMLHttpRequest calls, and the data is
<br>sent serialized as JSON<br><br>Anyone done anything similar with success ?<br><br>Currently when I export stuff from my database for the end client I am having to change %uXXXX in the text into \uXXXX<br>then decode the string as &#39;latin1&#39;, further decode it as &#39;unicode_escape&#39;, then recode it as &#39;utf8&#39;.
<br><br>This seems slightly &#39;dangerous&#39;.<br><br>Thanks for any help - this has cost me far too much time already.<br><br><br>Adam<br><br>_______________________________________________<br>Zope maillist &nbsp;- &nbsp;<a href="mailto:Zope@zope.org">
Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>** &nbsp; No cross posts or HTML encoding! &nbsp;**<br>(Related lists -<br>&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">
http://mail.zope.org/mailman/listinfo/zope-announce</a><br>&nbsp;<a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br></blockquote></div><br>