title: python mysql UnicodeEncodeError 'latin-1' codec can't encode character '\u2019'
body: <p>write a python program to insert data into mysql tables, when running the following code, it errors:</p>
  
  <pre><code>def public_figure_db_manage(self,type, posts, public_figure_id, public_figure_name):
  ...
      db_data = posts
      if type == "public_figure_posts":
          for item in db_data:
              is_exist_id_sql = "select * from fb_public_figure_posts where Post_ID = '" + item['id'] + "'"
              if cur.execute(is_exist_id_sql) == 0:
                  insert_sql = "INSERT INTO fb_public_figure_posts VALUES ('{0}','{1}','{2}','{3}','{4}',{5},'{6}','{7}',{8},{9},{10})".format(item['id'],item['permalink_url'],item['created_time'],item['updated_time'],item['from']['name'],item['from']['id'],item['message'],item['link'],item['likes']['summary']['total_count'],item['comments']['summary']['total_count'],public_figure_id)
                  cur.execute(insert_sql)
  </code></pre>
  
  <p>it errors:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Python/PyCharmProject/FaceBookCrawl/FBCrawl.py", line 268, in &lt;module&gt;
      publicfigure_download.public_figure_posts_storage(public_figure_name)
    File "C:\Python\PyCharmProject\FaceBookCrawl\publicfigure_download.py", line 103, in public_figure_posts_storage
      mysql_manage().public_figure_db_manage(type, posts, public_figure_id, public_figure_name)
    File "C:\Python\PyCharmProject\FaceBookCrawl\database_manage.py", line 42, in public_figure_db_manage
      cur.execute(insert_sql)
    File "C:\Python\Python36\lib\site-packages\pymysql\cursors.py", line 166, in execute
      result = self._query(query)
    File "C:\Python\Python36\lib\site-packages\pymysql\cursors.py", line 322, in _query
  conn.query(q)
    File "C:\Python\Python36\lib\site-packages\pymysql\connections.py", line 833, in query
      sql = sql.encode(self.encoding, 'surrogateescape')
  UnicodeEncodeError: 'latin-1' codec can't encode character '\u2019' in position 242: ordinal not in range(256)
  
  
  Process finished with exit code 1
  </code></pre>
  
  <p>it point that the sentence errors:</p>
  
  <pre><code>cur.execute(insert_sql)
  </code></pre>
  
  <p>it seems a problem of code, could you please help me</p>