invalid byte sequence in US-ASCII Rails 2.3.10


I just updated my rails app from 2.3.5 -> 2.3.10 and started hitting
this utf-8 encoding issue in my some views. The views use gsub and
trunacate ruby functions.

invalid byte sequence in US-ASCII

recmend@recmend:~/recmend/featureblogr$ rails -v
Rails 2.3.10
recmend@recmend:~/recmend/featureblogr$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]

recmend@recmend:~/recmend/featureblogr$ gem -v

Any help on fixing this issue is appreciated.

You may need to do more extensive changes at the DB connector level
and your configuration but try this for a quick fix. Add to the the
top of your breaking views:

<%# coding: UTF-8 %>