ProgrammingError - invalid byte sequence for encoding "UTF8"

Nico Grubert <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
Dear list members

I have 2 Zope servers (Zope 2.10.5, Python 2.4.4) on 2 physically 
separated machines. Both Zope servers access the same PostgreSQL (8.2.0) 
database on a remote server.

   Zope Server #1 has installed "psycopg2-2.0.5.1".
   Zope Server #2 has installed "psycopg2-2.0.6".

The Data.fs of both Zope Server #1 and #2 is the same.

On Zope Server #2, if I use a ZSQL Method to query the PostgreSQL 
database with umlauts (e.g. "lär") I get the following error:
On Zope Server #1 with installed "psycopg2-2.0.5.1" everything works fine.

Error Type: ProgrammingError
Error Value: invalid byte sequence for encoding "UTF8": 0xe47225 HINT: 
This error can also happen if the byte sequence does not match the 
encoding expected by the server, which is controlled by "client_encoding".

Traceback (innermost last):

     * Module ZPublisher.Publish, line 119, in publish
     * Module ZPublisher.mapply, line 88, in mapply
     * Module ZPublisher.Publish, line 42, in call_object
     * Module Shared.DC.ZRDB.DA, line 343, in manage_test
     * Module Shared.DC.ZRDB.DA, line 321, in manage_test
     * Module Shared.DC.ZRDB.DA, line 500, in __call__
       <SQL at /mysite/sql_searchMyDB>
     * Module Products.ZPsycopgDA.db, line 206, in query

If I query the PostgreSQL DB without umlauts, I get the results from the 
ZSQL method but on Zope Server #2 the umlauts are not displayed properly 
in the ZMI. On Server #1 the umlauts are correct.

I don't know if there is something wrong with my Zope or Python 
installation or if there is any difference between "psycopg2-2.0.5.1". 
and "psycopg2-2.0.6".

Any ideas?

Any tips are much appreciated.


Regards
Nico
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.