
Hi, is the Python module MonetSQLdb expected to handle unicode? Currently when INSERTing I must make sure that Python unicode types get converted to strings using UTF-8 encoding. Likewise when SELECTing I get UTF-8 encoded strings back. BTW, is it possible to use another encoding than UTF-8 with MonetDB? The Python DB API for SQLite allows inserting Python unicode types and yields unicode when selecting. MySQLdb allows specifying a 'charset' parameter in the connection constructor and uses this charset to automatically encode unicode objects when inserting. It also returns unicode objects. The following script raises an exception when used with MonetDB: import MonetSQLdb x = MonetSQLdb.connect() c = x.cursor() c.execute('DROP TABLE test') c.execute('CREATE TABLE test(id int, name varchar(20))') c.execute('INSERT INTO test (id, name) VALUES (%s, %s)', (0, u'm')) c.execute("SELECT * FROM test") value = c.fetchone()[-1] print type(value) c.close() x.close() --- Traceback (most recent call last): File "test.py", line 8, in <module> c.execute('INSERT INTO test (id, name) VALUES (%s, %s)', (0, u'm')) File "C:\Python25\lib\site-packages\mdb\MonetSQLdb\cursors.py", line 95, in execute self.errorhandler(self, exc, value) File "C:\Python25\lib\site-packages\mdb\MonetSQLdb\__init__.py", line 77, in defaulterrorhandler raise errorclass, errorvalue RuntimeError: !SELECT: identifier 'm' unknown