title: How does pyodbc determine the encoding?
body: <p>I'm fighting Sybase SQL Anywhere 12 together with Python (and Twisted) for several weeks by now and I even got my stuff working.</p>
  
  <p>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 <strong>UTF-8</strong>.</p>
  
  <p>If I run it on my Ubuntu box (Natty Narwhal) I get them in <strong>latin1</strong>.</p>
  
  <p>Needless to say, that I would prefer to get all my data in Unicode but that's not the point of this question. :)</p>
  
  <p>Both are 64bit boxes, both have a custom Python 2.7.1. with UCS4 and a custom built unixODBC 2.3.0.</p>
  
  <p>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?</p>
  
  <p>Hard facts:</p>
  
  <ul>
  <li>Python: 2.7.1</li>
  <li>DB: SQL Anywhere 12</li>
  <li>unixODBC: 2.3.0 (2.2.14 did behave the same), self compiled with identical flags</li>
  <li>ODBC driver: original from Sybase.</li>
  <li>CentOS 5 gives me UTF-8, Ubuntu Natty Narwhal gives me latin1.</li>
  </ul>
  
  <p>My odbc.ini looks like this:</p>
  
  <pre><code>[sybase]
  Uid             = user
  Pwd             = password
  Driver          = /opt/sqlanywhere/lib64/libdbodbc12_r.so
  Threading       = True
  ServerName      = dbname
  CommLinks       = tcpip(host=the-host;DoBroadcast=None)
  </code></pre>
  
  <p>I connect just by using DNS='sybase'.</p>
  
  <p>TIA!</p>