title: How do I take Nokogiri-scraped HTML and output it as UTF-8 to the terminal?
body: <p>I'm <em>very</em> new to programming, and am writing a small practice program in Ruby 1.9.3 that uses Nokogiri to query the Canadian parliamentary website with a postal code, and then prints the name of the corresponding Member of Parliament and their riding to the terminal.  </p>
  
  <p>My code fetches the page and isolates the MP's name/riding just fine, but displays UTF-8 characters as plain ASCII in the shell.  I want the UTF-8 characters to be displayed instead.</p>
  
  <p>I know the shell can handle UTF-8 because:</p>
  
  <pre><code>irb&gt; riding = "St-Jérôme"
  =&gt; "St-Jérôme"
  irb&gt; puts riding
  St-Jérôme
  =&gt; nil
  </code></pre>
  
  <p>The code I'm using to fetch the page:</p>
  
  <pre><code>page = Nokogiri::HTML(open("http://parl.gc.ca/ParlInfo/Compilations/HouseOfCommons/MemberByPostalCode.aspx?PostalCode=#{postalcode}"))
  </code></pre>
  
  <p>This is a sample of what this code returns when I type <code>puts page</code>:</p>
  
  <pre><code>&lt;span id="ctl00_cphContent_repMP_ctl00_grdConstituencyAddress_ctl02_Label12"&gt;St-J&amp;Atilde;&amp;copy;r&amp;Atilde;&amp;acute;me&lt;/span&gt;
  </code></pre>
  
  <p>So "<code>St-Jérôme</code>" becomes "<code>St-J&amp;Atilde;&amp;copy;r&amp;Atilde;&amp;acute;me</code>" in the page output, or just "<code>St-J&amp;Atilde;&amp;copy;r&amp;Atilde;&amp;acute;me</code>" in the terminal.</p>
  
  <p>Maybe there's a method to convert it while it's stored as a string variable?  Or maybe there's an option I can set in Nokogiri which will pull it down as UTF-8 instead of ASCII?</p>
  
  <p>I searched for a long time to find an answer on Google and Stack Overflow, and haven't found anything either relevant or that I understand; Again, I'm very new at this. If this is a duplicate, please point me in the right direction.</p>
  
  <p>Many thanks.</p>