Open GoogleCodeExporter opened 8 years ago
Original comment by mkleehammer
on 15 Jul 2009 at 1:58
All exceptions in Python 2.x use ANSI strings so pyodbc does also. I'm
currently
using the ANSI version of SQLGetDiagRec to retreive the error.
The Python 3.x version will obviously use Unicode for everything, so that'll
help.
In the meantime, I'm not exactly sure what the best approach is. There is a
connect
keyword unicode_results that forces all retrieved strings to be converted to
Unicode. This is sort-of a stopgap Unicode feature until the 3.x version is
released. If you really need Unicode errors, I guess I could add a
unicode_errors
keyword that would force errors to be returned in Unicode. Is that something
you
are interested in?
(Also note that I can't promise it will work -- I'm using the Python C
interface and
until I try it I'm not entirely sure passing Unicode values to the constructor
will
work. I think so, though.)
Original comment by mkleehammer
on 8 Aug 2009 at 2:45
Original issue reported on code.google.com by
wangle...@gmail.com
on 14 Jul 2009 at 12:26