I encountered the following problem.
DB - MS-SQL Server, running on a MS-Windows XP machine.
Scripting language - Python 2.5.1
DB interface modules - Python win32 extension: odbc,dbi

The relevant DB tables have Unicode fields (data type nchar and its
ilk).  They are populated by strings including Hebrew glyphs.

When I try to retrieve those tables in Python, the Hebrew glyphs become
question marks.  Latin glyphs, digits, and space are faithfully
reproduced.

Seems that the odbc module performs the equivalent of encoding the
Unicode data using the default encoder (excpet that unrepresentable
glyphs are converted into question marks, rather than raise exception).
The data type of the relevant values in the result set returned by
cursor.fetchmany() is 'str' rather than 'unicode'.

I tried to browse Python and Python/win32 documentation, and to google
for a solution to the problem, but found nothing helpful.

Did anyone encounter such a problem previously?
If yes, how was the problem solved?

NOTE:  using other modules instead of win32 odbc,dbi is an option, as
long as they are free (at least as in free beer), and use the standard
DBI interface for DB access from Python scripts.

                               Thanks,
                                    --- Omer
-- 
May the holy trinity of  $_, @_ and %_ be hallowed.
My own blog is at http://www.zak.co.il/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

_______________________________________________
Python-il mailing list
[email protected]
http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il

לענות