web2py assumes all DAL IO is already 'utf8', not unicode. The encoding/ decoding has to be done outside DAL. It is just a convention that keeps things simple.
On Jul 13, 7:26 am, "ont.rif" <ont....@gmail.com> wrote: > This patch seems to work with PostreSQL too. > Here is output of diff command. > > % diff -u sql.py sql_new.py > > --- sql.py 2009-07-13 20:20:37.000000000 +0800 > +++ sql_new.py 2009-07-13 20:20:30.000000000 +0800 > @@ -1017,6 +1017,7 @@ > self._connection.rollback() > > def executesql(self, query): > + query = query.decode( 'utf8' ) > self['_lastsql'] = query > self._execute(query) > try: > @@ -1476,6 +1477,7 @@ > > def insert(self, **fields): > query = self._insert(**fields) > + query = query.decode( 'utf8' ) > self._db['_lastsql'] = query > self._db._execute(query) > if self._db._dbname == 'sqlite': > @@ -2136,6 +2138,7 @@ > """ > > def response(query): > + query = query.decode( 'utf8' ) > self._db['_lastsql'] = query > self._db._execute(query) > return self._db._cursor.fetchall() > @@ -2173,6 +2176,7 @@ > def delete(self): > query = self._delete() > self.delete_uploaded_files() > + query = query.decode( 'utf8' ) > self._db['_lastsql'] = query > self._db._execute(query) > try: > @@ -2204,6 +2208,7 @@ > def update(self, **update_fields): > query = self._update(**update_fields) > self.delete_uploaded_files(update_fields) > + query = query.decode( 'utf8' ) > self._db['_lastsql'] = query > self._db._execute(query) > try: --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---