use the Unicode datatype for columns that have unicode in them. On Jul 6, 2006, at 5:33 PM, Brian Jarrett wrote:
> Hello all, > > I've written code to take data from a .dbf file (dbase IV) using > mxODBC and an ODBC dsn, create a postgres table with all the columns, > and then fill the table with the data from the .dbf file. > > On two separate tables, I've run into the following exception: > > sqlalchemy.exceptions.SQLError > invalid UTF-8 byte sequence detected near byte ... > > In one table, I'm dealing with a "password" field which is encrypted. > The workaround is for me to drop the field altogether, because I don't > need that field anyway. > > In the other table, the one that's more serious, I'm moving a name > from the .dbf file and I get this error. The name is "Eva /Erasmo > Ordoûo" as I get it from the .dbf file, then in the SQL statement that > is used, it looks like this: "'Eva /Erasmo Ordo\xfbo' prompting the > error: "invalid UTF-8 byte sequence detected near byte 0xfb" > > So I see that 'û' ends up as '\xfb' by the time sqlalchemy builds the > INSERT statement. It looks like the data is slightly messed up in the > original .dbf file because of the '/' present in a name, but I want it > to copy the data verbatim to the new table. > > Any ideas on how I can avoid this error and get my data across intact? > > Thanks, > Brian > > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users