[egenix-users] ODBC encoding problems

Charlie Clark charlie at egenix.com
Sun Oct 28 16:35:53 CET 2007

Am 28.10.2007, 16:09 Uhr, schrieb Martijn Pieters <mj at zopatista.com>:

> I am running into an encoding problem, where anything outside of base
> ASCII charset results in ODBC errors. The same rows can be fetched
> with isql without any problems.

> The setup uses the FreeTDS driver to connect to a MS-SQL database, and
> the error I get is:
>  ('42000', 2403, "[unixODBC][FreeTDS][SQL Server]WARNING! Some
> character(s) could not be converted into client's character set.
> Unconverted bytes were changed to question marks ('?').", 5125)

> I am unable to determine where the client's character set is set, the
> .encoding parameter on the mx.ODBC connection doesn't influence this.

You also need to set the string format

> Any hints on where to start debugging this? Note that the same query
> in isql does not produce the error and returns the characters in
> question without problems. The data in question uses latin-1
> characters only.

We would always recommend running a test using a different driver as  
FreeTDS does not always give all the information needed.

Charlie Clark

Professional Python Services directly from the Source
>>> 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,MacOSX for free ! ::::

     eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
            Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the egenix-users mailing list