title: Rails, why '.to_json' is escaping html entities
body: <p>This is what happens in a <code>rails console</code> (Rails v4.0.4):</p>
  
  <pre><code>irb(main):020:0&gt; "pepe&amp;pepe &lt;juan&gt;".to_json
  =&gt; "\"pepe\\u0026pepe \\u003Cjuan\\u003E\""
  </code></pre>
  
  <p>This is what happens in a <code>irb console</code> (Ruby 2.0.0p247):</p>
  
  <pre><code>irb(main):014:0&gt; "pepe&amp;pepe &lt;juan&gt;".to_json
  =&gt; "\"pepe&amp;pepe &lt;juan&gt;\""
  </code></pre>
  
  <p>I know I can override this behaviour but my concern is <strong>why Rails is doing this by default</strong>? which can be the consequences of not doing it?, because for me it looks like a good idea to override this behaviour and not escaping html entities but I'm sure I'm missing something.</p>