I have a Microsoft Excel file (saved as a CSV file) that contains a list of names. A few of the names have letters with an accent over it, like so:
Maria Vásquez
In my seed file, I parse the CSV file to create Person instances, like so:
CSV.foreach("peopleFile.csv", headers:true, header_converters: :symbol, encoding:'iso-8859-1:utf-8') do |row|
Person.create(
name: "#{row[1]}"
)
end
However, when I look in the Rails console, to see if that "á" came through fine with the accent over it, it appears like so:
name: "Maria V\u0087squez"
Also, when I render that person onto an HTML (html.erb) file, it appears like this on the webpage...completely ignoring the "a" altogether:
Maria Vsquez
Help. I thought I controlled for all of the character stuff when I included the " encoding:'iso-8859-1:utf-8' " bit in the "foreach" function that parses the CSV file. I would like any accented letters that is in my CSV file to appear that way in my database, in my console, and more importantly, on the web page. Thank you in advance :-)