I'm fighting Sybase SQL Anywhere 12 together with Python (and Twisted) for several weeks by now and I even got my stuff working.
There's only one annoyance left: If I run my script on CentOS 5 with a custom Python 2.7.1, which is the deployment platform, I get my results as UTF-8.
If I run it on my Ubuntu box (Natty Narwhal) I get them in latin1.
Needless to say, that I would prefer to get all my data in Unicode but that's not the point of this question. :)
Both are 64bit boxes, both have a custom Python 2.7.1. with UCS4 and a custom built unixODBC 2.3.0.
I'm at a loss here. I can't find any documentation on that. What makes pyodbc or unixODBC behave differently on the two boxes?
Hard facts:
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 connect just by using DNS='sybase'.
TIA!
I can't tell you why it's different, but if you add "Charset=utf-8" to your DSN, you should get the results you want on both machines.
Disclaimer: I work for Sybase in SQL Anywhere engineering.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With