title: Render HTML as string from Rails ERB template, no unicode characters
body: <p>I have the snippet below that runs without errors, however, it returns unicode characters in the response:</p>
  
  <pre><code>if params[:template] == 'Application Acknowledgement'
    render json: { :template =&gt; render_to_string(:template =&gt; "template.erb") }
  end
  </code></pre>
  
  <p>The ERB sends back the HTML template with the dynamic content, but the below HTML looks like this:</p>
  
  <p>HTML in template:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
    &lt;head&gt;
    &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>HTML returned by the above snippet:</p>
  
  <pre><code>\u003c!doctypehtml\u003e\n\u003chtml\u003e\n\t\u003chead\u003e
  </code></pre>
  
  <p>How can I return normal UTF-8 HTML from the controller as a string in Rails?</p>
  
  <hr>
  
  <p><strong>Addition</strong></p>
  
  <p>The problem lies in converting unicode string to json e.g.:</p>
  
  <pre><code>"абв".to_json
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code>"\"\\u0410\\u0411\\u0412\""
  </code></pre>
  
  <p>Whereas <code>JSON::dump('АБВ')</code> returns <code>"\"АБВ\""</code>, every single one of unicode characters passed to <code>render json:</code> becomes escaped.</p>
  
  <p>How to avoid escaping unicode symbols in rendering json?</p>