encoding and utf-8 exceptions after upgrade to Ruby 1.9.3 and rails 3.2
ever since I uploaded my new version to production from time to time I get encoding and utf-8 exceptions like these:
Encoding::CompatibilityError: incompatible encoding regexp match (Windows-31J regexp with UTF-8 string)
ArgumentError: invalid byte sequence in UTF-8
after seeing some post i added ot my application.rb
config.encoding = "utf-8"
What is it? and how do I fix? thanks
I had the same problem occuring "sometimes", I use now at the very top of each .rb files the following:
# encoding: UTF-8 class Whatever < ActiveRecord::Base ... end
The problem occurs when the file contains one/several accent(s) (as a french guy, I sometimes use it in comments).