djhenderson / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Question marks instead of unicode characters #172

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

    conn = pyodbc.connect('Driver=FreeTDS;TDS_Version=8.0;Server={};Port={};UID={};PWD={}')
    cur = conn.cursor()
    rows = cur.execute("select * from data order by row_id").fetchall()

What is the expected output? What do you see instead?

Column data contains unicode characters (cyrillic and turkish). System default 
encoding and locale set to "utf-8". Server (MSSQL2008) shows collation 
«cyrillic_general_ci_as» (if that should actually do something with it).

What version of the product are you using? On what operating system?

Server: Win2k8 server + MSSQL 2k8

Client:
FreeBSD 8.2
freetds-0.64_6,1
libiodbc-3.52.7
pyodbc==2.1.8

Please provide any additional information below.

tsql console session shows text correctly.

Original issue reported on code.google.com by aenor.realm on 25 Apr 2011 at 7:06

GoogleCodeExporter commented 9 years ago
Perhaps I should write a replacement for FreeTDS...  There are really only 2 
encoding supported in the ODBC specification: ANSI and UCS2, which is the 
2-byte Unicode used by Windows NT, 2-byte Python builds, etc.

Can you test setting FreeTDS to use UCS-2?  If it works, I'll update the FAQ 
appropriately.  (I realize it suggests UTF-8, but apparently that only works 
for some databases.  I will reword it.)  I don't have FreeTDS setup at the 
moment.

Original comment by mkleehammer on 20 May 2011 at 7:30

GoogleCodeExporter commented 9 years ago
I've tried to put UCS2, UCS-2 and UTF-8 into client charset settings - no 
effect.

Original comment by aenor.realm on 20 May 2011 at 8:15

GoogleCodeExporter commented 9 years ago
Fixed with pyodbc 3.0.6 and FreeTDS 0.91.

There were lots of Unicode fixes in pyodbc 3.0.x and FreeTDS 0.91 both.

Original comment by mkleehammer on 27 Sep 2012 at 10:22