I'm trying to select data from mssql table using python(I'm using pycharm).
One of the fields contains arabic letters, but the result of the select is '???????' Instead of the arabic letters. How do I get the arabic words correctly?
Im using pymssql. Im creating a connection and a cursor, and than running:
"cursor.execute(command)".
The command is:
"Select * from Table where Field = XXX"
It returns result, just not in the rigth encoding. Btw, in the table the arabic words are written correctly.
I tried printing the data to the console and writing it to a file, both failed(returned '????').
I've also added "# -- coding: utf-8 --" at the beginning of the file, so it can handle the non-ascii letters.
Any idea? Thanks
I needed to change the way I'm connecting to the database - instead of pymssql use pypyodbc.
Selecting non-ascii words from mssql table using python