<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:12pt;font-family:Arial">
<p>On Thursday 26 June 2008 15:12, Andreas Jung wrote:</p>
<p>&gt; --On 26. Juni 2008 14:09:50 +0000 Garry Saddington</p>
<p>&gt;</p>
<p>&gt; &lt;garry@schoolteachers.co.uk&gt; wrote:</p>
<p>&gt; &gt; I am using Zope 2.9 connected to a Posgres DB via psycopg. My database</p>
<p>&gt; &gt; encoding is UTF8.  I am getting the following error when users try to</p>
<p>&gt; &gt; insert text in the database containing £ signs: ERROR: invalid byte</p>
<p>&gt; &gt; sequence for encoding &quot;UTF8&quot;: 0xa3</p>
<p>&gt; &gt;</p>
<p>&gt; &gt; This is due to the encoding of a £ sign in the text being sent to the DB.</p>
<p>&gt; &gt; My question then is how do I make sure that all encodings submiitted from</p>
<p>&gt; &gt; forms are in the correct UTF8 format? Regards</p>
<p>&gt;</p>
<p>&gt; Use ensure that the HTML page uses UTF-8 as encoding</p>
<p>&gt; (either using &lt;meta-equiv...&gt; within the HTML page or by sending</p>
<p>&gt;</p>
<p>&gt; content-type: text/html; charset=utf-8</p>
<p>&gt;</p>
<p>&gt; as HTTP header.</p>
<p>&gt;</p>
<p>I have taken this a little further after trying all suggestions in the thread with no success and looked into zope.conf, specifically:</p>
<p></p>
<p><span style="font-style:italic"># Directive: default_zpublisher_encoding</span></p>
<p><span style="font-style:italic">#</span></p>
<p><span style="font-style:italic"># Description:</span></p>
<p><span style="font-style:italic">#     This controls what character set is used to encode unicode</span></p>
<p><span style="font-style:italic">#     data that reaches ZPublisher without any other specified encoding.</span></p>
<p><span style="font-style:italic">#</span></p>
<p><span style="font-style:italic"># Default: iso-8859-15</span></p>
<p><span style="font-style:italic">#</span></p>
<p><span style="font-style:italic"># Example:</span></p>
<p><span style="font-style:italic">#</span></p>
<p><span style="font-style:italic">#    default_zpublisher_encoding utf-8</span></p>
<p></p>
<p>As my pages all report as iso-8859-15 I thought a change here would help, but this happens:</p>
<p></p>
<p><span style="font-style:italic">  from OFS.content_types import guess_content_type</span></p>
<p><span style="font-style:italic">Error: 'default_zpublisher_encoding' is not a known key name</span></p>
<p></p>
<p>It works on this:  Zope Version  (Zope 2.9.0, python 2.4.2, win32) </p>
<p></p>
<p>And fails on this:  Zope Version  (Zope 2.9.0-, python 2.4.5, linux2) </p>
<p></p>
<p>Any further help would be appreciated. </p>
<p>regards</p>
<p>Garry</p>
<p></p>
<p>ps. just noticed the typo (not mine) in zope.conf <span style="font-style:italic"> - default_zpublisher_encoding </span>should be<span style="font-style:italic">  default-zpublisher-encoding</span></p>
<p>all sorted</p>
<p></p>
<p></p>
<p></p>
</body></html>