I am using django-pyodbc as a database on Ubuntu 12.04 LTS and MSSQL 2008 on a remote host. It works well, except for the returning Cyrillic characters. Instead, I see question marks - "?". I started an investigation into what might cause this problem.
As far as I understand, the MSSQL-django chain looks like this:
MSSQL ↔ FreeTDS ↔ unixODBC ↔ pyodbc ↔ django-pyodbc
So, I started with FreeTDS. When I run the query in tsql - it works well, I can see all the characters, including the Cyrillic alphabet.
The next one was isql - as far as I understand, I can check out a couple of FreeTDS ↔ unixODBC. And there I did not receive the correct data. In fact, when I run the query, the isql columns that contain Cyrillic characters are empty or consist of invisible characters. I assume that the problem is in communication between FreeTDS ↔ unixODBC. What can cause this problem? By the way, I also tried iusql - nothing has changed.
MSSQL mapping - Cyrillic_General_CI_AS.
Contents of freetds.conf:
[global] tds version = 4.2 dump file = /tmp/freetds.log debug flags = 0xffff timeout = 10 connect timeout = 10 client charset = UTF-8 text size = 64512 [egServer50] host = symachine.domain.com port = 5000 tds version = 5.0 [egServer70] host = ntmachine.domain.com port = 1433 tds version = 7.0 [rfxdigest] host = mssql-iis-1 port = 1433 tds version = 8.0 client charset = UTF-8
Content odbc.ini:
[RFX] Description = Rfx digest server Driver = FreeTDS Database = RFXDB Servername = rfxdigest TDS_Version = 8.0
Edit1 08/15/12
In python using pyodbc, I get '?' instead of cyrillic characters - I tried both versions of python: UCS2 and UCS4.
source share