[Zope-DB] psycopg insert into unicode problem

abraham.peter at freestart.hu abraham.peter at freestart.hu
Wed Nov 2 06:07:22 EST 2005


Hi,

I've installed zope2.7 and zope-psycopgda on Debian Sarge. (The official deb packages.) According to the ZopeBook 2.6 Relational Database Connectivity chapter a Psycopg_database_connection and 2 Z SQL methods were added to a test folder. The select query works without any problems, and The insert into works fine till I try to insert a string containing a character encoding over 127. I get the following error message:

Error, psycopg.ProgrammingError: ERROR: invalid byte sequence for encoding "UNICODE": 0xe16a6f insert into nevek (azon, nev) values( 13, 'Lájos');

In Z SQL method I wrote the following:

insert into nevek (azon, nev) values(
<dtml-sqlvar azon type="int">,
<dtml-sqlvar nev type="string">);

(azon=id, nev=name)
The postgres database is unicode encoded. What shall I do in order to insert these texts into database via zope? (with psql I can insert it smoothly.)

Thanx,

Peter
____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu


More information about the Zope-DB mailing list