Fxed encoding error when uploading files with non-ascii characters.
This commit is contained in:
parent
bf1c2b5ed2
commit
3792069fda
2 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ module FoodsoftFile
|
|||
def self.parse(file)
|
||||
articles, outlisted_articles = Array.new, Array.new
|
||||
row_index = 2
|
||||
::CSV.parse(file.read, {:col_sep => ";", :headers => true}) do |row|
|
||||
::CSV.parse(file.read.force_encoding('utf-8'), {:col_sep => ";", :headers => true}) do |row|
|
||||
# check if the line is empty
|
||||
unless row[2] == "" || row[2].nil?
|
||||
article = {:number => row[1],
|
||||
|
|
Loading…
Reference in a new issue