Re: pymssql: Problem with Unicode string

From: Thom Brown <thom(at)linux(dot)com>
To: orgilhp <orgilhp(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pymssql: Problem with Unicode string
Date: 2011-01-29 16:50:53
Message-ID: AANLkTi=h61SXQUkv9QmPFunRB3fPsrRiTQtnv0ipbjk3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29 January 2011 14:52, orgilhp <orgilhp(at)gmail(dot)com> wrote:
> Hello!
> I am using pymssql-1.9.908. And I have MSSQL2008 database server.
> I ran following code from python 2.6:
> -----------------------------------
>        import pymssql
>        conn = pymssql.connect(host='testserver', user='sa',
> password='sa', database='testdb', as_dict=True)
>        crms = conn.cursor()
>        crms.execute('SELECT cc_Name FROM tblUsers')
>        for line in crms.fetchall():
>            print 'cc_Name:', self.unicodify(line['cc_Name'])
>            break
>        crms.close()
> -----------------------------------
> the result is-> cc_Name: ?????, ???
> But the actual data is "Аймаг, хот" and I expect that the output would
> be "cc_Name: Аймаг, хот".
>
> Here is my question:
> How to get Unicode data from MSSQL database using pymssql library?
>
> Any suggestion would be highly appreciated!
> regards,
> Orgil.D

This is a PostgreSQL mailing list. Please direct this question to an
MSSQL or Python list instead.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2011-01-29 16:52:47 Re: pymssql Connection to the database failed for an unknown reason
Previous Message Matt Warner 2011-01-29 16:29:09 Re: Full Text Index Scanning