title: how can I reverse an html decimal special characters back to normal?
body: <p>Specifically, suppose I start with the string </p>
  
  <pre><code>  string ="hello \'i am \' me"
  </code></pre>
  
  <p>And then I textilize the string to get an output:</p>
  
  <pre><code>  textilize(string) =&gt; "&lt;p&gt;hello &amp;#8217;i am &amp;#8217; me&lt;/p&gt;"
  </code></pre>
  
  <p>And then, because I want to get a count of the characters visible to a person, I wish to strip the html tags, and reverse the special characters &#8217; to the simple apostrophe they are (ie ' or \'). Strip_tags is easy enough:</p>
  
  <pre><code> strip_tags(textilize(string)) =&gt; "hello &amp;#8217;i am &amp;#8217; me"
  </code></pre>
  
  <p>But I don't know how to reverse the special characters. If it helps, I know the method html_escape would have turned some characters like angle brackets into the decimal form:</p>
  
  <pre><code> html_escape("&gt;") =&gt; "&amp;gt;"
  </code></pre>
  
  <p>But I don't know of a rails method to reverse this. Anyone have suggestions on either a custom method or a rails method to accomplish this task?</p>