When creating a new web application, it’s a good practice to use Unicode encoding in your database even when your content are all in English. Radio21g.com is created with UTF-8 from day 1 with following 2 steps:
- To make sure your database is using Unicode to store the text data, make sure you create the database with encoding specified:
create database radio21g character set utf8;
- After the database ready, you also need to tell the rails Mysql adapter to save and retrieve the data as unicode. You do this in the last line of the /config/database.yml:
development: adapter: mysql database: database username: root password: host: localhost encoding: utf8
In addition to database related settings, your web page (RHTML) should also display the text and submit the user input in UTF-8. To achieve that, you need to:
- Specified the “charset=UTF-8″ in your HTML head:
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- Set the Content-Type header in the rails @headers object of each request. Usually this is done in the /app/controller/applicaiton.rb with a filter:
class ApplicationController < ActionController::Base end before_filter :set_charset def set_charset @headers["Content-Type"] = "text/html; charset=utf-8" end endFor Rails 2.0 and above, this step is not needed anymore as UTF-8 is the default setting in the @headers.

This website is very helpful for me. I’ll talked in this website many times!
I want to express some appreciation to the writer for bailing me out of such a challenge. Just after checking throughout the search engines and obtaining suggestions which are not beneficial, I figured my entire life was gone. Being alive devoid of the strategies to the issues you have resolved through your entire blog post is a critical case, as well as ones that would have in a negative way affected my entire career if I had not noticed your blog. Your actual mastery and kindness in taking care of a lot of stuff was very useful. I’m not sure what I would have done if I had not come upon such a stuff like this. I can also at this point look forward to my future. Thanks so much for this specialized and result oriented help. I won’t think twice to recommend your blog post to anyone who should have guidance about this situation.
[Get] Netbomber They Like ME WP Plugin | Get Unlimited Traffic To Your Website Now Get It Here
Right now there will come a place in your life when “FUN” will no longer signifies tavern browsing, going to clubs, being out there unti 4am or perhaps consuming excessive. It indicates motion pictures, venturing out to a family event cuisine, bed time tales, and slumbering in 8pm.
Interesting article did you write this yourself.
Your own contemplation of the minority of these requests is prescribed to you by A FELLOW PARISHIONER. It was to this meaningful public document that 1 of our first orators, Mr MAGG (of Little Winkling Street), adverted, when he unsealed the big debate of the fifteenth of November by saying, ‘Sir, I keep in my own grip an anonymous slander’ - and when the interruption, with which he was at that point assailed by the opposite faction, delivered rise to that unforgettable discourse on a point of command which must ever be commemorated with interest by political assemblies.
Add A Comment