I have been fighting Sybase SQL Anywhere 12 along with Python (and Twisted) for several weeks, and I even got my work done.
There is only one annoyance left: if I run my script on CentOS 5 using custom Python 2.7.1, which is the deployment platform, I get my results as UTF-8 .
If I run it in my Ubuntu field (Natty Narwhal), I get them in latin1 .
Needless to say, I would rather get all my data in Unicode, but that is not a question of this question. :)
Both are 64-bit, both have their own Python 2.7.1. with UCS4 and custom unixODBC 2.3.0.
I don’t get it here. I can not find documentation about this. What does pyodbc or unixODBC do differently in two blocks?
Hard facts:
- Python: 2.7.1
- DB: SQL Anywhere 12
- unixODBC: 2.3.0 (2.2.14 did the same), compiled with identical flags itself
- ODBC driver: original from Sybase.
- CentOS 5 gives me UTF-8, Ubuntu Natty Narwhal gives me latin1.
My odbc.ini looks like this:
[sybase]
Uid = user
Pwd = password
Driver = /opt/sqlanywhere/lib64/libdbodbc12_r.so
Threading = True
ServerName = dbname
CommLinks = tcpip(host=the-host;DoBroadcast=None)
I only connect using DNS = 'sybase'.
TIA!
hynek source
share