1 2 3 4 5 |
csv_string = params[:file].tempfile.open.read.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?') CSV.parse(csv_string, headers: true, quote_char: "\x00", force_quotes: true, col_sep: col_sep) do |row| ... end |
1 2 3 4 5 |
csv_string = params[:file].tempfile.open.read.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?') CSV.parse(csv_string, headers: true, quote_char: "\x00", force_quotes: true, col_sep: col_sep) do |row| ... end |