title: Python MySQL query format : Issue with unicode and encode
body: <p>I have data base that has Spanish, German etc information, I thought I figured how to handle the issue but it doesn't look like working: </p>
  
  <p>Here is how I am currently handling it: </p>
  
  <pre><code>formatted_user_name = user_name.replace("__", " ") # this is domain related 
  query_user_id = ur'''SELECT user_id from user where user_name like "  {uName}"'''.format(uName=unicode(formatted_user_name,'utf-8', errors='strict'))
  self.cur2.execute(query_user_id.encode('utf-8'))
  </code></pre>
  
  <p>but I get the following error: </p>
  
  <pre><code>    query_user_id = ur'''SELECT user_id from user where user_name like "{uName}"'''.format(uName=unicode(formatted_user_name,'utf-8', errors='strict'))
  TypeError: decoding Unicode is not supported
  </code></pre>
  
  <p>My question is is the this the best way to format the queries that has strange characters?</p>