Uwe Grauer wrote:
> I think i have a hint on what is wrong with unicode strings.
> I copied the update string which i got from dabo and did some tests.
> 
> Consider the following:
> #! /usr/bin/env python
> # -*- coding: utf-8 -*-
> 
> import kinterbasdb as dbapi
> 
> dbapi.init(type_conv=200)
> con = dbapi.connect(host='athlon28',
> database='/opt/firebird/data/fbtool-dev.fdb',
>                     user='sysdba', password='masterkey', charset='UTF8')
> cur = con.cursor()
> sqlstr = u"update ETYP set ETYP.e_val = 'asdf\xf6' where ETYP.iid=1000002"
> print sqlstr
> sqlstr = sqlstr.encode('utf-8')
> print sqlstr
> cur.execute(sqlstr)
> con.commit()
> 
> If i comment out the line
> sqlstr = sqlstr.encode('utf-8')
> 
> I get the same error that i get in dabo.
> 
> Does this help?
> I still don't know what this means for a dabo fix, so i wanted
> to ask if this rings a bell for you.
> 
> Uwe
> 

Because of my findings i tried to do another test:
I changed dCursorMixin.py:
 svn diff dCursorMixin.py
Index: dCursorMixin.py
===================================================================
--- dCursorMixin.py     (revision 3210)
+++ dCursorMixin.py     (working copy)
@@ -264,6 +264,7 @@
                # Some backends, notably Firebird, require that fields
be specially marked.
                if not isinstance(sql, unicode):
                        sql = unicode(sql, self.Encoding)
+               sql = sql.encode(self.Encoding)
                sql = self.processFields(sql)

                try:

This worked as expected.
I still don't know what that means, but maybe someone might know.

Uwe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to