title: python to mssql encoding problem
body: <p>Greetings</p>
  
  <p>By using <strong>pymssql</strong> library, I want to write data to a MSSQL database however I encounter encoding issues. Here is my sample code to write to the DB:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  import _mssql
  
  ....
  Connection info data here
  ....
  
  
  def mssql_connect():
      return _mssql.connect(server=HOST, user=USERNAME, password=PASS, database=DB, charset="utf-8")
  
  con = mssql_connect()
  INSERT_EX_SQL = "INSERT INTO myDatabsae (Id, ProgramName, ProgramDetail) VALUES (1, 'Test Characters ÜŞiçÇÖö', 'löşüIIğĞü');"
  con.execute_non_query(INSERT_EX_SQL)
  con.close()
  </code></pre>
  
  <p>Sadly the data that was written to DB is corrupted:</p>
  
  <p><img src="https://i.stack.imgur.com/K5qaD.png" alt="enter image description here"></p>
  
  <p>The Collacation of my mssql db is: <code>Turkish_CI_AS</code>
  How can this be solved?</p>