title: Python with MySql unicode problems
body: <p>I need to call MySQL stored procedure from my python script. As one of parameters I'm passing a unicode string (Russian language), but I get an error;</p>
  
  <blockquote>
    <p>UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)</p>
  </blockquote>
  
  <p>My script:</p>
  
  <pre><code>  self.db=MySQLdb.connect("localhost", "usr", "pass", "dbName")
    self.cursor=self.db.cursor()
    args=("какой-то текст") #this is string in russian
    self.cursor.callproc('pr_MyProc', args)
    self.cursor.execute('SELECT @_pr_MyProc_2') #getting result from sp
    result=self.cursor.fetchone()
    self.db.commit()
  </code></pre>
  
  <p>I've read that setting <code>charset='utf8'</code> shuld resolve this problem, but when I use string:</p>
  
  <pre><code>self.db=MySQLdb.connect("localhost", "usr", "pass", "dbName", charset='utf8')
  </code></pre>
  
  <p>This gives me another error;</p>
  
  <blockquote>
    <p>UnicodeEncodeError: 'utf-8' codec can't encode character '\udcd1' in position 20: surrogates not allowed</p>
  </blockquote>
  
  <p>Also I've trying to set parametr <code>use_unicode=True</code>, that's not working.</p>