[DB-SIG] UNICODE

M.-A. Lemburg mal at lemburg.com
Thu Jul 24 12:37:51 EDT 2003


Reuven Abliyev wrote:
> I using ACCESS & ADO
> Database contains some data in Hebrew
> connect to DB - OK
> getting Recordset  - OK
> BUT
> when I'm trying to load data I've got into COMBOBOX
> I'm getting this message:
> UnicodeError: ASCII encoding error: ordinal not in range(128)
> 
> How can I solve this

Not sure how you can solve this with ADO, but mxODBC can
be setup to read Unicode directly from the database:

     To have mxODBC connections run
     in native Unicode mode you have to set them up using the
     .stringformat attribute:

     connection = mx.ODBC.Windows.DriverConnect(...)
     connection.stringformat = mx.ODBC.Windows.NATIVE_UNICODE_STRINGFORMAT
     # or
     connection.stringformat = mx.ODBC.Windows.MIXED_STRINGFORMAT

     For more information, have a look at the data types section
     and the connection.stringformat documentation:

        http://www.egenix.com/files/python/mxODBC.html#Datatypes


-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Software directly from the Source  (#1, Jul 24 2003)
 >>> Python/Zope Products & Consulting ...         http://www.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________
2003-07-01: Released mxODBC.Zope.DA for FreeBSD             1.0.6 beta 1




More information about the DB-SIG mailing list