title: Incompatible encodings with ruby and Nokogiri HTML
body: <p>I'm parsing an external HTML page with Nokogiri. That page is encoded with ISO-8859-1. Part of the data I want to extract, contains some &ndash; (dash) html entities:  </p>
  
  <pre><code>xml = Nokogiri.HTML(open("http://flybynight.com.br/agenda.php"), nil, 'ISO-8859-1')
  f = xml.xpath("//div[@style='background-color:#D9DBD9; padding:15px 12px 10px 10px;']//div[@class='tit_inter_cnz']/text()")
  f[0].text #=&gt; Preview M/E/C/A \u0096 John Digweed
  </code></pre>
  
  <p>In the last line, the String should be rendered on the browser with a <strong>dash</strong>. The browser correctly renders it if I specify my page as ISO-8859-1 encoding, however, my Sinatra app uses UTF-8. How can I correctly display that text in the browser? Today is is being displayed as a square with a small number inside.
  I tried force_encoding('ISO-8859-1'), but then I get a CompatibilityError from Sinatra.  </p>
  
  <p>Any clues?  </p>
  
  <p>[Edit]
  Below are screenshots of the app:</p>
  
  <p>-> Firefox with character encoding UTF-8
  <img src="https://i.stack.imgur.com/ARWoI.png" alt="Firefox with character encoding UTF-8"></p>
  
  <p>-> [Firefox with character encoding Western (ISO-8859-1)
  <img src="https://i.stack.imgur.com/KrxRg.png" alt="Firefox with character encoding Western (ISO-8859-1)"></p>
  
  <p>It's worth mentioning that in the ISO-8859-1 mode above, the dash is shown correctly, but there is another incorrect character with it just before the dash. Weird :(</p>