I am trying to parse a CSV file generated from an Excel spreadsheet.
Here is my code
file = File.open("input_file")
csv = CSV.parse(file)
ArgumentError: invalid byte sequence in UTF-8
ISO 8859-1 (Latin-1)
You need to tell Ruby that the file is in ISO-8859-1. Change your file open line to this:
The second argument tells Ruby to open read only with the encoding ISO-8859-1.