Hi,

I am using the following code to upload a CSV and store it into my
sqlite db:


file = params[:file]
temp = CSV.new(file.tempfile, {:headers => false, :col_sep => ";"})

temp.each do |row|
@newhash << {:var1 => row[0], :var2 => row[1]}
end

Finally I create a new record out of the @newhash above, but I got an
error before, when I have a special character in the row:
"invalid byte sequence in UTF-8"

I have german special characters: ä, ö, ü

Without these characters, my code is working!!!!

How can avoid the error by using the right encoding?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to