0

I am running ruby 1.8.7, rails 2.3.5 and mysql database. The record in mysql database looks like 'In Light of Egypt’s Internet Block, U.S. “Kill Switch Bill” Raises Eyebrows'

However, the rails app displays it as :

In Light of Egypt’s Internet Block, U.S. “Kill Switch Bill†Raises Eyebrows

The mysql connection in my database.yml is set as utf8 In my environment.rb, I also tried with and without explicitly setting
config.i18n.default_locale = :en

None of these things worked. Any help would be great. Thanks

Edit: Clarification:

When I go to mysql commandline and query, I get the following record back: Light of Egypt’s Internet Block, U.S. “Kill Switch Bill” Raises Eyebrows'

When I display the same string in rails app, it appears as: In Light of Egypt’s Internet Block, U.S. “Kill Switch Bill†Raises Eyebrows

truthSeekr
  • 1,603
  • 4
  • 25
  • 44

1 Answers1

0

Mysql database was created with a default encoding of latin1 which caused the problem. I had to recreate the database and recode existing data in UTF8. Recoding didn't exactly clean it up but all new data is stored in UTF8 format now.

truthSeekr
  • 1,603
  • 4
  • 25
  • 44