title: specifying erb template file encoding
body: <p>I try to run a rails app (Airesis), using apache2 and passenger. The erb files contain UTF-8 encoded characters. I see</p>
  
  <pre><code>Encoding::CompatibilityError (incompatible character encodings: ASCII-8BIT and UTF-8):
  </code></pre>
  
  <p>errors, corresponding to lines in the erb containing utf-8 encoded characters.
  Interestingly another machine with the exact same setup up from rvm does not have this issue. The only difference we could identify that the working machine had hu_HU.UTF-8 as the default locale, as the non-working had C. But the problem did not go away after changing the system locale.</p>
  
  <p>Tried to specify </p>
  
  <pre><code>&lt;% # -*- coding: UTF-8 -*- %&gt;
  </code></pre>
  
  <p>In the beginning of the erb file, checked that the Application class have</p>
  
  <pre><code>config.encoding = "utf-8"
  </code></pre>
  
  <p>added</p>
  
  <pre><code>Encoding.default_external = "UTF-8"
  </code></pre>
  
  <p>to the beginning of config/application.rb, added</p>
  
  <pre><code>export RUBYOPT=-Ku
  </code></pre>
  
  <p>to /etc/default/apache2, and </p>
  
  <pre><code>SetEnv RUBYOPT=-Ku
  </code></pre>
  
  <p>to the apache config file.</p>
  
  <p>None of them solved the problem.</p>
  
  <p>I use apache2, and all ruby related things, including passenger installed using rvm by root.
  Versions:
  ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
  Rails 4.0.2
  passenger 4.0.56</p>
  
  <p>Any help is appreciated.</p>