From f803adf9f20a1be27824736d123d7ed54ba31ba7 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Thu, 1 Aug 2013 10:08:57 +0100 Subject: Try to convert csv files of public bodies into utf-8 before importing them. --- app/controllers/admin_public_body_controller.rb | 2 +- spec/fixtures/files/fake-authority-type.csv | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb index 078af12f4..ec2a08dbc 100644 --- a/app/controllers/admin_public_body_controller.rb +++ b/app/controllers/admin_public_body_controller.rb @@ -146,12 +146,12 @@ class AdminPublicBodyController < AdminController if params[:csv_file] csv_contents = params[:csv_file].read @original_csv_file = params[:csv_file].original_filename + csv_contents = normalize_string_to_utf8(csv_contents) # or from previous dry-run temporary file elsif params[:temporary_csv_file] && params[:original_csv_file] csv_contents = retrieve_csv_data(params[:temporary_csv_file]) @original_csv_file = params[:original_csv_file] end - if !csv_contents.nil? # Try with dry run first errors, notes = PublicBody.import_csv(csv_contents, diff --git a/spec/fixtures/files/fake-authority-type.csv b/spec/fixtures/files/fake-authority-type.csv index 4aa618ad1..cb25050c6 100644 --- a/spec/fixtures/files/fake-authority-type.csv +++ b/spec/fixtures/files/fake-authority-type.csv @@ -1,3 +1,4 @@ ,North West Fake Authority,north_west_foi@localhost ,Scottish Fake Authority,scottish_foi@localhost ,Fake Authority of Northern Ireland,ni_foi@localhost +,Gobierno de Aragón,spain_foi@localhost -- cgit v1.2.3