"invalid byte sequence in US-ASCII" on i18n form

I’m getting the error “invalid byte sequence in US-ASCII” when using i18n on Rails 3.0.0beta with Ruby 1.9.1. I’ve searched extensively on Google and the problem seems to happen with 2.3.x versions as well (when using Ruby 1.9.1).

I just set the default language to portuguese and added this locale file: http://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/pt-BR.yml. Then, when I use a scaffold-generated form with validation and the validation fails, the line of f.error_messages raises this ArgumentError of invalid byte sequence. Does anybody knows what is happening? Is this a Rails bug? (To reproduce the error, just run this app, go to /users/new and submit the empty form.)

Thanks guys


I had the exact same problems, still have, and I use 1.8.7.

There are a lot of recommendations and patches in lighthouse for rails 2.3.x, but I really haven’t tried anything.



i have the same problem, did you solve it ?


aha, i went back to ruby 1.8.7 and it works ... thx rvm :slight_smile:

Did you solve the problem?

Martin P wrote in post #961213:

Did you solve the problem?

not really, i used rvm (http://rvm.beginrescueend.com/) to try different ruby/rails versions.

Without any change in the code, all is working with ruby 1.8.7 / rails 2.3.x, and not working with ruby 1.9.2 / ruby 2.3.x.

Now, i moved to ruby 1.9.2 and rails 3.0.x, and everything is working fine.