mattfordham / csv_validator

A CSV Validator for Rails 3
MIT License
33 stars 9 forks source link

Invalid byte sequence in UTF-8 #1

Open bigardone opened 11 years ago

bigardone commented 11 years ago

Hi! I'm getting this error when trying to validate a non CSV file.

/Users/user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/csv.rb:2058:in `init_separators'
  /Users/ricardogarciavega/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/csv.rb:1590:in `initialize'
  /Users/user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/csv.rb:1349:in `open'
  /Users/user/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/csv.rb:1411:in `read'
  (gem) csv_validator-0.0.3/lib/csv_validator.rb:22:in `validate_each'
  (gem) activemodel-3.2.13/lib/active_model/validator.rb:153:in `block in validate'
  (gem) activemodel-3.2.13/lib/active_model/validator.rb:150:in `validate'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:310:in `_callback_before_2445'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:418:in `_run__1234688691138222075__validate__3461540008247755959__callbacks'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_validate_callbacks'
  (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
  (gem) activemodel-3.2.13/lib/active_model/validations.rb:228:in `run_validations!'
  (gem) activemodel-3.2.13/lib/active_model/validations.rb:195:in `valid?'
  app/controllers/importacion_controller.rb:14:in `create'
...

It only happens when I select a non CSV file in my form.

Thanks in advance

Sohair63 commented 7 years ago

This issue need to be fixed as this does not work for .csv files with utf-8 format