[egenix-users] ODBC encoding problems

M.-A. Lemburg mal at egenix.com
Sun Oct 28 16:34:22 CET 2007

On 2007-10-28 16:09, Martijn Pieters wrote:
> 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.
> 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.

Please send the table schema and your freetds.conf entry. Also
include information of whether you're using the default mxODBC
configuration or one of the Unicode support modes.

Also check:


The fact that isql displays the characters only suggests that
the FreeTDS ODBC driver tells mxODBC to fetch the character
data using a non-SQLCHAR data type.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Oct 28 2007)
>>> 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