[DB-SIG] International characters in database table names

M.-A. Lemburg mal@lemburg.com
Thu, 07 Jun 2001 10:20:42 +0200

Ryan Weisenberger wrote:
> We're currently using mxODBC 1.1.1 to retrieve content from databases for
> our search engine product.
> Recently we've started running into the problem of international characters
> in database table names and column names.
> What is the standard for this?  Currently, trying to send a unicode SQL
> query in mxODBC 1.1.1 causes an error (exceptions.TypeError: SQL command
> must be a string).  I'm assuming that this is resolved in mxODBC 2.0, but
> I'm not sure how to use it.

mxODBC 2.0 has experimental Unicode support for the column data on
input and output. It does not support sending SQL statements
using Unicode, nor does it provide a way to extract the column
names (in cursor.description) using Unicode.

The reason for this is that most ODBC drivers don't work well with
Unicode and mxODBC would have to use a complete new ODBC API
to get at those Unicode table names (the SQLxxxW() APIs).
> Can anyone describe to me what the "standard" method is for accessing
> content stored in a table or column with an international character set?
> (using mxODBC, if possible.)

It should be possible to tell the database or the ODBC driver
to translate the Unicode names into e.g. UTF-8. These can then
be accessed using mxODBC (even 1.1.1) in the normal way. Please
refer to the ODBC driver or database documentation on how this
can be achieved.

Hope this helps,
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
Company & Consulting:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/