title: Can't store UTF-8 in RDS despite setting up new Parameter Group using Rails on Heroku
body: <p>I'm setting up a new instance of a Rails(2.3.5) app on Heroku using Amazon RDS as the database. I'd like to use UTF-8 for everything. Since RDS isn't UTF-8 by default, I set up a new Parameter Group and switched the database to use that one, basically per <a href="http://matthew.mceachen.us/blog/howto-configure-an-amazon-rds-instance-to-use-utf-8-925.html" rel="nofollow">this</a>. Seems to have worked:</p>
  
  <pre><code>SHOW VARIABLES LIKE '%character%';
  
  character_set_client        utf8
  character_set_connection    utf8
  character_set_database    utf8
  character_set_filesystem    binary
  character_set_results      utf8
  character_set_server        utf8
  character_set_system        utf8
  character_sets_dir       /rdsdbbin/mysql-5.1.50.R3/share/mysql/charsets/
  </code></pre>
  
  <p>Furthermore, I've successfully setup Heroku to use the RDS database. After rake db:migrate, everything looks good: </p>
  
  <pre><code>CREATE TABLE `comments` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `commentable_id` int(11) DEFAULT NULL,
    `parent_id` int(11) DEFAULT NULL,
    `content` text COLLATE utf8_unicode_ci,
    `child_count` int(11) DEFAULT '0',
    `created_at` datetime DEFAULT NULL,
    `updated_at` datetime DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `commentable_id` (`commentable_id`),
    KEY `index_comments_on_community_id` (`community_id`),
    KEY `parent_id` (`parent_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  </code></pre>
  
  <p>In the markup, I've included:</p>
  
  <pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  </code></pre>
  
  <p>Also, I've set:</p>
  
  <pre><code>production:
    encoding: utf8
    collation: utf8_general_ci
  </code></pre>
  
  <p>...in the database.yml, though I'm not very confident that anything is being done to honor any of those settings in this case, as Heroku seems to be doing its own config when connecting to RDS.</p>
  
  <p><strong>Now, I enter a comment through the form in the app: "Úbe®  ƒåiL", but in the database I've got "ÃšbeÂ®  Æ’Ã¥iL"</strong></p>
  
  <p>It looks fine when Rails loads it back out of the database and it is rendered to the page, so whatever it is doing one way, it's undoing the other way. If I look at the RDS database in Sequel Pro, it looks fine if I set the encoding to "UTF-8 Unicode via Latin 1". So it seems Latin-1 is sneaking in there somewhere.</p>
  
  <p>Everything works in development, when connecting to a local MySQL database.</p>
  
  <p>Somebody must have done this before, right? What am I missing?</p>