theyworkforyou / quien_nos_representa

https://theyworkforyou.github.io/quien_nos_representa/
0 stars 0 forks source link

Make sure the CSV files are interpreted as UTF-8 #5

Closed chrismytton closed 8 years ago

chrismytton commented 8 years ago

YourNextRepresentative/Apache is serving up the CSV files with Content-Type: text/csv. This means that Ruby is interpreting them as ASCII-8BIT rather than UTF-8, which in turn causes problems with Liquid, which expects everything to be in UTF-8. By saving them to the filesystem Ruby reads them as UTF-8 by default, which is what we want and eliminates the error.

This might also be a good way to rebuild the site when there's new data. We simply put the new CSVs onto the master branch and then the site will be rebuild from them.