[egenix-users] Enabling unicode?

M.-A. Lemburg mal at egenix.com
Wed Oct 27 22:51:04 CEST 2004


Chuck Bearden wrote:
> I have been having unicode problems from time to time with mx.ODBC,
> libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on
> some recent flavor of free Red Hat.
> 
> Being a little slow on the uptake, I only just noticed that there is a
> constant HAVE_UNICODE_SUPPORT.  I just checked it:
> 
> $ python
> Python 2.3.3 (#1, Apr 12 2004, 14:00:40)
> [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> 
>>>>import mx.ODBC.iODBC
>>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT
> 
> 0
> 
> 
> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this:
> 
> *shared*
> 
> 
> mxODBC  mxSQLCodes.c mxODBC.c \
>         -DMAL_DEBUG \
>         -DWANT_UNICODE_SUPPORT \
>         -DMISSING_SETUP
> 
> 
> which is I think the default.  So, although I wanted Unicode, I didn't get it.
> 
> Did I fail to build iODBC or FreeTDS in such a way as to enable
> mx.ODBC to define HAVE_UNICODE?  Or did I do something else wrong?

If you compile the package with the setup.py apporach,
edits to Setup or Setup.in don't have any effect.

Default for iODBC is not to build with Unicode support,
whereas it is always enabled for unixODBC.

Nowadays, it is safe to enable Unicode for both.

In order to enable it for iODBC as well, you have to edit
mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define
there.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Oct 27 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the egenix-users mailing list