My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 172: Question marks instead of unicode characters
1 person starred this issue and may be notified of changes. Back to list
Status:  Complete
Owner:  ----
Closed:  Sep 2012


 
Reported by aenor.realm, Apr 25, 2011
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.
May 20, 2011
Project Member #1 mkleehammer
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.
Status: Investigating
May 20, 2011
#2 aenor.realm
I've tried to put UCS2, UCS-2 and UTF-8 into client charset settings - no effect.
Sep 27, 2012
Project Member #3 mkleehammer
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.

Status: Complete

Powered by Google Project Hosting