title: Input is not proper UTF-8, indicate encoding on rails
body: <p>I'm wondering how i would go about fixing this error:</p>
  
  <p><code>Input is not proper UTF-8, indicate encoding</code></p>
  
  <p>Located here:
  <a href="http://xml.skiddlecdn.co.uk/affiliates/all.xml" rel="nofollow noreferrer">http://xml.skiddlecdn.co.uk/affiliates/all.xml</a></p>
  
  <p>The code im using looks like this:</p>
  
  <pre><code>skiddlexml = 'http://xml.skiddlecdn.co.uk/affiliates/all.xml'
  doc = Nokogiri::XML(open(skiddlexml))
  
  @ticket_json = []
  doc.css('event#' + params[:id]).css('ticket').each do |node|
    children = node.children
    @ticket_json &lt;&lt; {
      'name' =&gt; children.css('name').inner_text,
      'faceValue' =&gt; children.css('faceValue').inner_text,
      'bookingFee' =&gt; children.css('bookingFee').inner_text,
      'quantity' =&gt; children.css('quantity').inner_text,
      'status' =&gt; children.css('status').inner_text
    }
  end
  
  doc.css('event#' + params[:id]).each do |node|
    @skiddle_url = node['link'].chomp('?sktag=XXX') + '?sktag=13942'
  end
  respond_to do |format|
     format.json  { render :json =&gt; {:tickets =&gt; @ticket_json, :skiddle_url =&gt; @skiddle_url } }
  end
  </code></pre>
  
  <p>I'm wondering if theres a way of decoding it and reencoding it so the code is still the same?</p>
  
  <p>Sam</p>
  
  <p><strong>Edit</strong></p>
  
  <p>as you can see in the events controller it currently uses a params id to search the XML file,</p>
  
  <p>If we take the id <code>12987613</code> it can't fine it, However sublime shows the id showing on line 137631</p>