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 152: How to get unicode data from nvarchar column?
1 person starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 153
Owner:  ----
Closed:  Feb 2011


 
Reported by orgi...@gmail.com, Jan 30, 2011
What steps will reproduce the problem?

I can't select unicode data from nvarchar column. pyodbc always returns ascii data.

My code is:
import pyodbc
conn = pyodbc.connect(r'DRIVER={FreeTDS};SERVER=10.0.0.61\mssql2008;DATABASE=eoffice_clone;UID=erp;PWD=123;')
crms = conn.cursor()
crms.execute('SELECT cc_Name FROM tblHR_CodeClass')
for line in crms:
    print 'cc_Name:', line.cc_Name
    break
conn.close()

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

expected output: 'cc_Name: Аймаг, хот'
but instead: 'cc_Name: ?????, ???'

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

I have pyodbc-2.1.8, TDS version 4.2, python-2.6, ubuntu-10.4


Please provide any additional information below.
I am trying to work with MSSQL2008 database on ubuntu using python.
Almost all text fields are NVARCHAR in my database.
At first, I just want to get unicode data as it stored in database.

Feb 27, 2011
Project Member #1 mkleehammer
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 153

Powered by Google Project Hosting