I am trying to write a UTF-8 character in a CSV file with csv library of Ruby. And I have got an error:
csv ruby write problem ASCII-8BIT (Encoding::CompatibilityError)
#create csv file
CSV.open(CSV_file,"wb",) do |csv|
csv << First_line
rows.each do |r|
csv << r.generate_array
end
end
That's the code where UTF-8 conflicts with ASCII-8BIT.
Example text that fails:
demás
CSV.open(CSV_file,"w:utf-8"? YOur example can't be used to show details. E.g. what isrowsin your code?