Sha256: 122e9713a5e6b0fd1f2a4fe2b561a9de701e72bada3b5805a1b86999640613d2
Contents?: true
Size: 872 Bytes
Versions: 18
Compression:
Stored size: 872 Bytes
Contents
require 'spec_helper' fixture_path = 'spec/fixtures' describe 'loading file with UTF-8 characters in the header' do # file which caused issues because of UTF-8 characters in the header it 'loads the file with force_utf8 flag set' do options = {col_sep: ";", force_utf8: true} data = SmarterCSV.process("#{fixture_path}/problematic.csv", options) data.length.should eq 7 end it 'loads the file with strings as keys' do options = { file_encoding: 'iso-8859-1:UTF-8', # important! col_sep: ";", strings_as_keys: true, } data = SmarterCSV.process("#{fixture_path}/problematic.csv", options) data.length.should eq 7 data.first.keys.sort.should eq [ "compte", "date_de_comptabilisation", "date_opération", "date_valeur", "libellé", "montant", "référence" ] end end
Version data entries
18 entries across 18 versions & 2 rubygems