Installation guide

6. mxODBC Connection Objects
On input, Python 8-bit strings are passed to the ODBC driver as-is.
Unicode objects are converted to Python 8-bit strings assuming the
cursor's encoding setting (see the
cursor.encoding attribute) prior to
passing them to the ODBC driver.
On output, all string columns are fetched as strings and passed back as
Python 8-bit string objects. Unicode data from the database is converted
to Python 8-bit string objects assuming the cursor's encoding setting
(see the
cursor.encoding attribute).
This setting emulates the behavior of previous mxODBC versions and is
the default.
MIXED_STRINGFORMAT
This format lets the ODBC driver decide which string format to use for
the communication, providing the most efficient way of communicating
with the driver.
Input and output conversion is dependent on the data format the ODBC
driver expects or returns for a given column. If the driver returns a
string, a Python string is created; if it returns Unicode data, a Python
Unicode object is used.
UNICODE_STRINGFORMAT
This format can be used to emulate Unicode support with a database
backend that doesn't have a native Unicode data type or where the
ODBC driver cannot handle Unicode data.
On input, Python strings are passed to the ODBC driver as-is. Unicode
objects are converted to 8-bit strings using the cursor's encoding setting
(see the
cursor.encoding attribute) and then passed to the ODBC
driver.
On output, string data is converted to Python Unicode objects, based on
the same conversion technique.
Use this setting if you plan to use Unicode objects with non-Unicode
aware databases (e.g. by setting the encoding to UTF-8 -- be careful
though: multibyte character encodings usually take up more space and
are not necessarily compatible with the database's string functions).
NATIVE_UNICODE_STRINGFORMAT
This format should be used for databases and applications that support
native Unicode data communication.
String columns are converted to Python Unicode objects assuming the
cursor's encoding setting (see the
cursor.encoding attribute) and then
passed as Unicode to the ODBC driver.
On output, string data is always fetched as Unicode data from the
ODBC driver and returned using Python Unicode objects.
Note that even though mxODBC may report that Unicode support is enabled
(default in Python 2.0 and later;
HAVE_UNICODE_SUPPORT is set to 1), the
ODBC driver may still reject Unicode data. In this case, an
InternalError of
99