This is how Your FreeTDS config should look like:
;----------------------
[mssql2008]
    host = 10.0.0.61
    port = 1433
    tds version = 7.0
;----------------------


Here is the code with pymssql:
#----------------------
import pymssql
conn = pymssql.connect(host='mssql2008', user='erp', password='123',
database='eoffice_clone', charset = "utf8")
cur = conn.cursor()
cur.execute('SELECT cc_Name FROM tblHR_CodeClass')
for row in cur:
    print 'cc_Name: %s' % (row[0])
conn.close()
#----------------------

Also if You print this to linux console check terminal character encoding
(sould be UTF-8 too)!

Cheers,
Adnan

On Tue, Feb 1, 2011 at 6:52 AM, Orgil <orgi...@gmail.com> wrote:

> > Hi,
> > I have expirience with pymssql and mssql server, and that works fine
> > (utf-8).
> > Did You try utf-8?
>
> I think that I have tried pymssql using charsets including utf-8,
> utf-16, iso-****.
> But I have no luck there. I can not get unicode datas. Also, I have
> read that pymssql does not support unicode. This news made me find
> other libraries and I found pyodbc. But still I have no luck. Unicode
> turns ? sign always.
> Now I am at a corner, I'm stuck!!!!
>
> If you succeeded with pymssql and unicode data, please suggest me how
> to do so!
> Please help me to get out from this terrible corner!
>
> My code which uses pymssql is here:
>        import _mssql
>        conn = _mssql.connect(server='10.0.0.61\mssql2008',
> user='erp', password='123', database='eoffice_clone',
> charset='utf-16')
>        conn.execute_query('SELECT cc_Name FROM tblHR_CodeClass')
>        for line in conn:
>            print 'cc_Name: %s' % (line['cc_Name'])
>            break
>        conn.close()
>
> regards,
> Orgil
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to