title: Ruby/Rails CSV parsing, invalid byte sequence in UTF-8
body: <p>I am trying to parse a CSV file generated from an Excel spreadsheet.</p>
  
  <p>Here is my code</p>
  
  <pre><code>require 'csv'
  file = File.open("input_file")
  csv = CSV.parse(file)
  </code></pre>
  
  <p>But I get this error</p>
  
  <pre><code>ArgumentError: invalid byte sequence in UTF-8
  </code></pre>
  
  <p>I think the error is because Excel encodes the file into <code>ISO 8859-1 (Latin-1)</code> and not in <code>UTF-8</code></p>
  
  <p>Can someone help me with a workaround for this issue, please</p>
  
  <p>Thanks in advance.</p>