Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7019037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:07:49+00:00 2026-05-27T23:07:49+00:00

I’m setting up a new instance of a Rails(2.3.5) app on Heroku using Amazon

  • 0

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 this. Seems to have worked:

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/

Furthermore, I’ve successfully setup Heroku to use the RDS database. After rake db:migrate, everything looks good:

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;

In the markup, I’ve included:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Also, I’ve set:

production:
  encoding: utf8
  collation: utf8_general_ci

…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.

Now, I enter a comment through the form in the app: “Úbe® ƒåiL”, but in the database I’ve got “Úbe® Æ’Ã¥iL”

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.

Everything works in development, when connecting to a local MySQL database.

Somebody must have done this before, right? What am I missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:07:50+00:00Added an answer on May 27, 2026 at 11:07 pm

    There’s a simpler way. You can specify the encoding in your DB connection string. Edit the RDS add-on, and append ?encoding=utf8&collation=utf8_general_ci

    Worked well for me, no changes to the project.

    e.g.:

      mysql://user:pass@abc.rds.amazonaws.com/my-db?encoding=utf8&collation=utf8_general_ci
    

    Reference:
    http://blog.arvidandersson.se/2011/09/27/setting-activerecord-connection-to-utf8-on-heroku

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.