How to fix ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8)
<p>I am getting the following error [ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8)]</p>

<p>Here is the log...</p>

<pre><code>    Completed 500 Internal Server Error in 318ms 
    Jan 09 23:29:19 burro app/web.1:  ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8): 
    Jan 09 23:29:19 burro app/web.1:       97:         &lt;!-- &lt;td&gt;&lt;%= row.notes.gsub("\n", "&lt;br&gt;").html_safe %&gt;&lt;/td&gt; --&gt; 
    Jan 09 23:29:19 burro app/web.1:       98:       &lt;/tr&gt; 
    Jan 09 23:29:19 burro app/web.1:       99:     &lt;% end %&gt; 
    Jan 09 23:29:19 burro app/web.1:      100:   &lt;/tbody&gt; 
    Jan 09 23:29:19 burro app/web.1:      101: &lt;/table&gt; 
    Jan 09 23:29:19 burro app/web.1:      102:  
</code></pre>

<p>HERE IS THE CODE:</p>

<pre><code>&lt;td&gt;&lt;%= row.notes.force_encoding("utf-8") %&gt;&lt;/td&gt;
    &lt;!-- &lt;td&gt;&lt;%= row.notes.gsub("\n", "&lt;br&gt;").html_safe %&gt;&lt;/td&gt; --&gt;
  &lt;/tr&gt;
&lt;% end %&gt;
</code></pre>

<p>
</p>

<p>I have all these in the correct rb and erb files?</p>

<pre><code>&lt;%# encoding: utf-8 %&gt;


config.encoding = "utf-8"

Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8

@data.each do |sr|
    sr.notes = sr.notes.to_s.force_encoding("UTF-8")
  end
</code></pre>

<p>The data in the db is encrypted so I can't run a query on my MongoDB data to see what special character is causing the issue, when displaying records?</p>