Anand, thank you for the encoding suggestion. This solved the illegal quoting problem for me.
Note: If you want the iterator to skip over the header row add headers: :first_row
, like so:
CSV.foreach("test.csv", encoding: "bom|utf-8", headers: :first_row)