title: Python - mysqldb inserting unicode fails
body: <p>Python 2.6.1, mysql 5.1 on osx snow leopard.</p>
  
  <p>In my python code to connect I am doing;
  use_unicode=True, charset = "utf8"</p>
  
  <p>mysql tells me</p>
  
  <pre><code>mysql&gt; SHOW VARIABLES LIKE "character_set%";
  +--------------------------+--------------------------------------------------------+
  | Variable_name            | Value                                                  |
  +--------------------------+--------------------------------------------------------+
  | character_set_client     | latin1                                                 |
  | character_set_connection | latin1                                                 |
  | character_set_database   | latin1                                                 |
  | character_set_filesystem | binary                                                 |
  | character_set_results    | latin1                                                 |
  | character_set_server     | latin1                                                 |
  | character_set_system     | utf8                                                   |
  | character_sets_dir       | /usr/local/mysql-5.1.52-osx10.6-x86_64/share/charsets/ |
  +--------------------------+--------------------------------------------------------+
  8 rows in set (0.00 sec)
  </code></pre>
  
  <p>So we are all good there.
  My table structure is defined as utf8</p>
  
  <pre><code>CREATE TABLE `urls` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `url` varchar(300) DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `url_idx` (`url`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>My statement is like</p>
  
  <pre><code>insert("INSERT INTO urls (url) VALUES (%s)", (url, ))
  </code></pre>
  
  <p>but with a unicode string I get an error</p>
  
  <pre><code>UnicodeEncodeError: 'ascii' codec can't encode character u'\xb4' in position 7: ordinal not in range(128)
  </code></pre>
  
  <p>I am clue less....</p>