title: Heroku and Rails: how to set utf-8 as the default encoding
body: <p>Today, I created a copy of a working app, which runs perfectly on Heroku, and tried to deploy it on Heroku as a starting point for a new project.</p>
  
  <p>I added the new folder as a git repository, created a new remote repository on GitHub, edited the config file and gave new names to the databases, created the new databases and tried to deploy on Heroku.</p>
  
  <p>Now the app crashed on startup because Heroku finds some utf-8 text inside my source files and doesn't recognize them:</p>
  
  <pre><code>2011-06-27T14:23:10+00:00 app[web.1]: /app/app/controllers/home_controller.rb:118: invalid multibyte char (US-ASCII)
  2011-06-27T14:23:10+00:00 app[web.1]: /app/app/controllers/home_controller.rb:118: syntax error, unexpected $end, expecting '}'
  2011-06-27T14:23:10+00:00 app[web.1]: ...tue azioni, conquista la città!"}
  </code></pre>
  
  <p>How can I tell Rails and Heroku that all of my source file are utf-8 encoded?
  Should I add a UTF-8 BOM in EVERY file?  That's crazy and I was not doing so in my previous app that worked beautifully.</p>
  
  <p>I'm using Rails 2.3.6. </p>