Django <-> SQL Server 2005, text encoding problem -
I am trying to store Django data using MS SQL Server 2005:
(Pyodbc + freetds)
Unless I am storing the string consisting of ASCII characters, everything is fine. When I am using Unicode (eg '\ Xc5 \ x82'), the DJ throws it on the programming error:
Programming error / admin / clean / picratagestracz / AD / (' 42,000 ',' [42000] [Free TDS] [SQL Server] Incoming Tablet Data Stream (TDS) protocol stream is incorrect. Stream ended unexpectedly (4002) (SQLXACDRW) ')
The mark of the previous element is:
parameter ('\ xc5 \ x82',) Self & lt; Django.db.backends.sql_server.pyodbc.base.CursorWrapper Object 0x92ef8ec & gt; [Cli_punktrejestracji] from Sql 'SELECT (1) as [a] from [cli_punktrejestracji]. [Adres] =? '
BTW does not seem to work under Linux, django-mssql requires pythoncom library, are we right?
We use DJs with SQL Server 2005. / P>
Are you using the ODBC driver? Free TDS?
We tried to find a good ODBC driver for the use of Linux / Unix, which will not do the above errors on Unicode (and others) - and failed miserably. None of the least three drivers - we can dig at least three names if you want - there was no success in working with Unicode strings through the Dinggo-Pidobcci.
What we were doing, sad it might sound, was to decide to run a Django on a Windows server (Apache + mod_wsgi) and use Microsoft's SQL Native ODBC driver.
It works fine - according to Unicode - when we do this.
Comments
Post a Comment