title: How can I avoid putting the magic encoding comment on top of every UTF-8 file in Ruby 1.9?
body: <p>I have a Rails project with a lot of Cyrillic strings in it. </p>
  
  <p>It worked fine on Ruby 1.8, but Ruby 1.9 assumes source files are US-ASCII-encoded unless you provide an <code># encoding: utf-8</code> comment at the top of the source file. At that point the files are not considered <code>US-ASCII</code>.</p>
  
  <p>Is there a simpler way to tell Ruby "This application is UTF8-encoded. Please consider all and any included source files as UTF8 unless declared otherwise"?</p>
  
  <hr>
  
  <p>UPDATE: </p>
  
  <p>I wrote "<a href="http://leonid.shevtsov.me/en/how-to-insert-the-encoding-utf-8-directive-automatically-in-ruby-1-9-files" rel="noreferrer">How to insert the encoding: UTF-8 directive automatically in Ruby 1.9 files</a>" which appends the encoding directive automatically if it's needed.</p>